I use twitter bootstrap 3. I added fixed top navbar. I have dropdown buttons on navbar. When user clicks on button, a dropdown menu opens. For desktop users it is ok. But for mobile users, when user scrolls down dropdown links, the page in the back also scrolls.
Is it possible to disable background page scroll when user scrolls dropdown links ?
Fiddle: http://jsfiddle.net/mavent/2g5Uc/1/
When user touches dropdown part and touches like the green arrow, background page scrolls like red arrow in this screenshot:
<nav class="navbar navbar-inverse navbar-fixed-top visible-xs" role="navigation">
<div class="navbar-header" style="text-align:center;">
.......
</div>
Edit: I checked that, that and that.
Edit: This doesn't work. This stops all page scrolling.
$('#my_navbar_div').bind('touchmove', function(event)
{
event.preventDefault();
});
This doesn't work. Doesn't changed anything in behaviour:
$('#my_navbar_div').hover(function() {
$(document).bind('touchstart touchmove',function(){
$("body").css("overflow","hidden");
});
}, function() {
$(document).unbind('touchstart touchmove');
});