开发者

jQuery UI Dialog cause page jump on open & close on ASP.NET

I have an ASP.NET C# page, with image thumbnails in it.

I created a script that opens a jQuery UI Dialog on each hover on a thumbnail that shows me the thumbnail in larger size in a dialog view, and when I hover out - dialog closes.

My little annoying problem is, that in every mouseover (trigger dialog to open) - the page makes itself 'longer' - a s开发者_如何学运维crollbar appears on the side of the browser, and it seems like the page gets longer when a dialog is openning, but it shouldn't do so.

When I hover off (mouseout) - the dialog disappears and the page returns to its normal state.

Because of this- when I hover through the thumbnails, my page 'jumps'.

I looked for a solution for this, and I've added return false; for each dialog open, and close - and it still doesn't make any different.

Sorry for the unperfect english, and thanks for all helpers!


I finally got my solution - for all interested:

open: function(event, ui){  
   /*  
    * Scrollbar fix   
    */  
   $('body').css('overflow','hidden');  
} 

I added this to dialog's opening event and it fixed the issue!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜