我需要有关弹出div的帮助,而不是关闭 [英] I need help about popup div which is not closing

查看:62
本文介绍了我需要有关弹出div的帮助,而不是关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个弹出式div。 div正如预期的那样出现在屏幕上,带有完整的CSS。但它没有关闭,关闭按钮不起作用,在后台点击也无法正常工作,请帮助



HTML代码:



更多HTML教程

点击我



I have a popup div. div is appearing on screen as expected with complete css. But its not closing, closing button is not working and click in the background is also not working, plz help

HTML Code:

More HTML Tutorials
Click me



< form>

< input type =textname =random/>




< button type =buttonclass =closeid =close>点击关闭< / button>



< / form>



<form>
<input type="text" name="random"/>


<button type="button" class="close" id="close">Click to close</button>

</form>





Javascript代码:



Javascript Code:

<pre lang="Javascript">



$(document).ready(function(){

$('a.popup-window')。click(function(){



var popupBox = $(this).attr('href');

$(popupBox).fadeIn(400);





var popMargTop =($(popupBox).height()+ 24)/ 2;

var popMargLeft =( $(popupBox).width()+ 24)/ 2;



$(popupBox).css({

'margin-top ':-popMargTop,

'margin-left': - popMargLeft

});



$( 'body')。append('


$(document).ready(function() {
$('a.popup-window').click(function(){

var popupBox=$(this).attr('href');
$(popupBox).fadeIn(400);


var popMargTop = ($(popupBox).height() +24)/2;
var popMargLeft = ($(popupBox).width() +24)/2;

$(popupBox).css({
'margin-top':-popMargTop,
'margin-left':-popMargLeft
});

$('body').append('

');

$('#mask')。fadeIn(400);

返回false ;



});



$('button.close,#mask')。live( 'click',function(){



$('#mask,.popupInfo')。fadeOut(400,function(){

$('#mask')。remove();



});

返回false;

});

});
');
$('#mask').fadeIn(400);
return false;

});

$('button.close, #mask').live('click', function(){

$('#mask, .popupInfo').fadeOut(400, function(){
$('#mask').remove();

});
return false;
});
});

推荐答案

(文件).ready(function(){
(document).ready(function() {


('a.popup-window')。点击(function(){



var popupBox =
('a.popup-window').click(function(){

var popupBox=


(this).attr('href');
(this).attr('href');


这篇关于我需要有关弹出div的帮助,而不是关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆