开发者

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

开发者 https://www.devze.com 2023-01-14 12:10 出处:网络
i have an mo开发者_开发知识库dal pop up i am showing it in the middle of screen using javascript

i have an mo开发者_开发知识库dal 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.


You might want to check out this CSS based solution: http://www.wpdfd.com/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.com/web-design/examples/modal-window/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号