I am using something like facebox, and want the main window scrolling bar to be disabled. One catch though, There is a scroll bar inside the facebox ponent, which needs to be able to scroll.
What I am trying to fix is the following case:
when scrolling the internal scrolling element (inside facebox), when scroll ends, it scrolls the page down further.
I am using something like facebox, and want the main window scrolling bar to be disabled. One catch though, There is a scroll bar inside the facebox ponent, which needs to be able to scroll.
What I am trying to fix is the following case:
when scrolling the internal scrolling element (inside facebox), when scroll ends, it scrolls the page down further.
Share Improve this question asked Apr 1, 2011 at 3:11 IzzyCooperIzzyCooper 5961 gold badge5 silver badges15 bronze badges2 Answers
Reset to default 7do it in css:
body {
overflow: hidden;
}
this would hide the scrollbar in the main window
i went into the facebox.js file and added
$('body').css('overflow', 'hidden');
to
loading: function() {
init()
if ($('#facebox .loading').length == 1) return true
showOverlay()
$('#facebox .content').empty()
$('body').css('overflow', 'hidden');
$('#facebox .body').children().hide().end().
append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')
and added $('body').css('overflow', ''); to the end of the document
* Bindings
*/
$(document).bind('close.facebox', function() {
$(document).unbind('keydown.facebox')
$('#facebox').fadeOut(function() {
$('#facebox .content').removeClass().addClass('content')
$('#facebox .loading').remove()
$(document).trigger('afterClose.facebox')
$('body').css('overflow', '');
})
hideOverlay()
})
})(jQuery);
This stops the scroll when open and when closed put the scroll back in, it worked for me at http://www.vestedutility..au/home_electrical_saftey_check.php
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744737909a4590859.html
评论列表(0条)