开发者

lightbox showing on top of the window

my jquery datatable is too large intially i am showing data with the lightbox which contains html page. I have 100 rows intially. But when i show my lightbox it is ope开发者_如何学运维ned on top of the window so user have to go on top and somtimed he feels nothing happens beacuse lightbox is not visible. Please show to open my lightbox on same location or when user click to show lightbox page would automatically scroll on top but i prefer if first is implemented. Thanks in advance...


You can just scroll your lightbox to where they're looking. Something like:

$(window).scroll(function()
{
    $('#lightbox').stop().animate({ "marginTop": ($(window).scrollTop() - 50) + "px" }, "slow");
});

You'll want to call that after the lightbox is shown.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜