admin管理员组文章数量:1415484
i have an modal pop up i am showing it in the middle of screen using javascript
$('div.openIDPopup').css({ 'height': $(document).height() + 'px',
'width': $(window).width() + 'px',
'visibility': 'visible'
})
.fadeIn('slow');
$('div.openId').css({ 'visibility': 'visible',
'top': ($(window).height() / 4) + 'px',
'left': ($(window).width() / 3) + 'px'
})
.fadeIn('slow');
but on resizing the screen it is staying there as it is positioned absolutely how to get that feature.
i have an modal pop up i am showing it in the middle of screen using javascript
$('div.openIDPopup').css({ 'height': $(document).height() + 'px',
'width': $(window).width() + 'px',
'visibility': 'visible'
})
.fadeIn('slow');
$('div.openId').css({ 'visibility': 'visible',
'top': ($(window).height() / 4) + 'px',
'left': ($(window).width() / 3) + 'px'
})
.fadeIn('slow');
but on resizing the screen it is staying there as it is positioned absolutely how to get that feature.
Share Improve this question asked Aug 31, 2010 at 10:40 MacMac 7,5639 gold badges36 silver badges70 bronze badges2 Answers
Reset to default 3You might want to check out this CSS based solution: http://www.wpdfd./editorial/thebox/deadcentre4.html
It relies on using a negative margin and I think it works great.
see here for how its done: http://www.sohtanaka./web-design/examples/modal-window/
本文标签:
版权声明:本文标题:javascript - how to show an modal pop up in the center of screen and maintain the position on resizing the screen also - Stack O 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745230786a2648815.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论