lauriemustafic / jquery-nicescroll

Automatically exported from code.google.com/p/jquery-nicescroll
0 stars 0 forks source link

Wrong vertical scrollbar position when opening any JQuery UI dialog with animation #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. When opening or closing any JQuery UI dialog with animation using show 
and/or hide option with effect and duration properties, i.e. show {effect: 
"fadeIn", duration: 500} and/or hide {effect: "fadeOut", duration: 500} the 
vertical (do not tested with horizontal) scrollbar appears in wrong position. 
Only after using mouse wheel or keyboard navigation the scrollbar goes to the 
right position.

I am using nicescroll 300RC8 on Windows XP with Firefox 16.0.2, Chrome 
23.0.1271.64 or IE8 (same problem with all browsers).

Temporary soliution for me is to use getNiceScroll().hide() before closing the 
dialog, but didn't find any soliution for this problem when opening the dialog.

Original issue reported on code.google.com by tekila...@gmail.com on 3 Dec 2012 at 10:01

GoogleCodeExporter commented 8 years ago
You need to notice nicescroll when div has changed (hidden or showed).
So when you call show function has completed you need to call resize on you div 
with nicescroll.

Original comment by inuya...@gmail.com on 5 Dec 2012 at 8:53

GoogleCodeExporter commented 8 years ago
Thank's for your respond.

Yes, I know that and I'm using that. Before, this didn't work for me. If I 
understand well, $( "#my-div" ).getNiceScroll().resize() is associated more 
with "#my-div" content and scrollbar height acording that content, but not with 
a scrollbar position in a "#my-div". By default the vertical scrollbar should 
appear at the top of the right side of a div. In case when using dialog with 
"show" or "hide" animation it appears somewhere out of a dialog till the 
navigation key is pressed or mouse wheel is used.

Now I found, that $( "#my-div" ).getNiceScroll().resize().show() in dialog open 
method solves the problem when opening the dialog with animation, but only in 
that case the scrollbar was hidden at that moment (i.e. $( "#my-div" 
).getNiceScroll().hide() was used somewhere in the code before).

Original comment by tekila...@gmail.com on 6 Dec 2012 at 9:01

GoogleCodeExporter commented 8 years ago

Original comment by inuya...@gmail.com on 3 Apr 2013 at 7:57

GoogleCodeExporter commented 8 years ago
Hello again :)

The similar problem is with draggable dialogs $( "dialog" ).dialog({
draggable: true }); In that case scrollbars stay in the position where
dialog was opened.

Original comment by tekila...@gmail.com on 11 Apr 2013 at 9:07