87,901
社区成员
发帖
与我相关
我的任务
分享
img{ border:0px;}
#registerwindow{ width:600px; height:400px; top:50px; right:100px; background:#FFF; display:none; border:5px #999 solid; position:absolute; z-index:999;}
#modelshade{width:100%; height:100%; background:#000; display:none; position:absolute; top:0px; z-index:0;}
<div id="registerwindow">
<h1 align="center">注册</h1><br>
<div style="width:250px; margin:0 auto;">
<form>
用户名:<input type="text" name="username" size="20"><br>
密 码:<input type="password" name="password" size="20"><br>
<input type="submit" name="submit" value="注册" >
</form>
</div>
</div>
$('document').ready(function(){ <!-- 注册model start-->
$('a.model').click(function(){
var modelID = $(this).attr('rel');
$('#'+modelID).fadeIn(2000).prepend('<a href="#" class="close"><img src="images/close.png" class="close_button" title="close window" alt="close"></a>');
$('.close_button').css({'margin-left':'535px','margin-top':'0px'});
$('body').append('<div id="modelshade"></div>');
$('#modelshade').css('opacity','0.8').fadeIn(2000);
$('a.close,#modelshade').click(function(){
var thismodelID= $('a.close').parent().attr('id');
$('#modelshade,#'+thismodelID).fadeOut(function(){
$('a.close,#modelshade').remove();
});
return false;
}); return false;
});
<!-- 注册model end-->
});
$('document').ready(function(){
$('#content').click(function(){
$('#rightcontent').load('1.html #rightcontent > p');
//e.preventDefault();
return false;
});
<!-- 注册model start-->
$('a.model').click(function(){
var modelID = $(this).attr('rel');
$('#'+modelID).fadeIn(2000).prepend('<a href="#" class="close"><img src="images/close.png" class="close_button" title="close window" alt="close"></a>');
$('.close_button').css({'margin-left':'535px','margin-top':'0px'});
$('body').append('<div id="modelshade"></div>');
$('#modelshade').css('opacity','0.8').fadeIn(2000);
return false;
});
$('a.close,#modelshade').click(function(){
var thismodelID= $('a.close').parent().attr('id');
$('#modelshade,#'+thismodelID).fadeOut(function(){
$('a.close,#modelshade').remove();
});
return false;
});
<!-- 注册model end-->
});
$('a.close,#modelshade').click(function(){
var thismodelID= $('a.close').parent().attr('id');
$('#modelshade,#'+thismodelID).fadeOut(function(){
$('a.close,#modelshade').remove();
});
return false;
});
<a href="#" rel="registerwindow" class="model">注册</a>