Reputation: 10936
If dialog height more than main window height we can scroll down through this dialog, but also main window scrolls too behind it (on the background).
Is it possible to make main window fixed while dialog is opened and scrolling down?
Thanks!
Upvotes: 0
Views: 1342
Reputation: 758
For anyone else searching for an answer to this question, this post provides the following as an answer:
create: function(event, ui) {
$("body").css({ overflow: 'hidden' })
},
beforeClose: function(event, ui) {
$("body").css({ overflow: 'inherit' })
}
Also, make sure the height or maxHeight option is set in the dialog or else it will not display scrollbars.
Upvotes: 1
Reputation: 41
You could try this:
$('#yourDialog').hover(function(){
// on hover
$('body').css({'overflow':'hidden'});
}, function(){
// off hover
$('body').css({'overflow':'visible'});
});
Upvotes: 4