7

As you can see on this link, http://jsbin.com/ozapol/9 ,

Jquery disables the scrollbars on some versions of IE and the latest version of chrome. (I didnt try any other yet...)

Is there a way to keep scrollbars enabled to be able to scroll through a long long dialog ?

Thank you ! Bye

Nice solution for Internet Explorer (Thanks to jk.)

html {overflow-y : scroll}

Brutal workaround for Chrome (Thanks to jk.)

On Chrome, JqueryUI Hijacks mouse events on the scrollbars. This looks like a bug that is referred in the links above. In order to remove those bindings, you have to unbind events each time you create a modal dialog :

$("#longdialog").dialog({
 open: function(event, ui) {
 window.setTimeout(function() {
 jQuery(document).unbind('mousedown.dialog-overlay')
 .unbind('mouseup.dialog-overlay');
 }, 100);
 },
 modal:true
});

There is the final example : http://jsbin.com/ujagov/2

Links to bug reports :

  1. http://bugs.jqueryui.com/ticket/4671
  2. http://wiki.jqueryui.com/w/page/34725121/Visual-Test-Page-Cleanup
asked Jan 20, 2012 at 0:22
3

4 Answers 4

5

You can keep scrollbars enabled with:

html {overflow-y: scroll;}

You could add that CSS programmatically so it doesn't affect every page of the site and possibly the design.

And, you may have to unbind the mouse events that the modal dialog hijacks:

$("#longdialog").dialog({
 open: function(event, ui) {
 window.setTimeout(function() {
 jQuery(document).unbind('mousedown.dialog-overlay')
 .unbind('mouseup.dialog-overlay');
 }, 100);
 },
 modal:true
});

See Scrollbar problem with jQuery UI dialog in Chrome and Safari

answered Jan 20, 2012 at 2:12
8
  • Hello, Thank you for you answer but unfortunately this doesn't look to work. I added this CSS part in my sample and it's still not working : jsbin.com/ozapol/5 Commented Jan 20, 2012 at 11:24
  • Actually it does work on Internet explorer but it doesn't on Chrome... Any Idea ? Commented Jan 20, 2012 at 11:28
  • @NicolasThery Works for me in Chrome on the Mac and PC. Not sure why it isn't working for you. Commented Jan 20, 2012 at 17:23
  • It's not working either on version 16.0.912.75 for Windows nor the version 16.0.912.77 that I just installed. Commented Jan 24, 2012 at 10:02
  • 1
    @NicolasThery Yes, but it only works with the scrollwheel. Try this: jsbin.com/ujagov/edit#javascript,html Commented Jan 25, 2012 at 15:40
2

This bug fixed at jQueryUi-1.10. Here is link with the issue http://bugs.jqueryui.com/ticket/4671.

answered Feb 21, 2013 at 16:18
0

Add following code to your css-file:

 .ui-dialog .ui-dialog-content {
 overflow-y: scroll;
 }
 #longdialog{
 height: 450px;
 }

The overflow doesn't work because the height was set to auto, define a specific height to the container div

answered Jan 20, 2012 at 15:13
1
  • I'm sorry but I dont want the scroll bar inside the dialog but for the whole page. I dont want many scroll bars in my interface. I updated the example :jsbin.com/ozapol/9 Commented Jan 24, 2012 at 10:10
0

If you don't want to or can't upgrade to jQuery UI 1.10, this is the solution for you:

https://stackoverflow.com/a/7740756/354756

answered Dec 11, 2013 at 20:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.