javascript - how to show an modal pop up in the center of screen and maintain the position on resizing the screen also - Stack O

i have an modal pop up i am showing it in the middle of screen using javascript$('div.openIDPopup&

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 badges
Add a ment  | 

2 Answers 2

Reset to default 3

You 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/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745230786a4617669.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信