当我的网站上的Modal(来自http://twitter.github.com/bootstrap)打开时,我希望我的身体在使用鼠标滚轮时停止滚动.
当模态打开但我没有成功时,我试图调用下面的javascript
$(window).scroll(function() { return false; });
AND
$(window).live('scroll', function() { return false; });
Run Code Online (Sandbox Code Playgroud)
请注意我们的网站放弃了对IE6的支持,但IE7 +需要兼容.
我正在创建一个左侧有固定菜单的网站,使用 jQuery 单击时可以看到该菜单。我的问题是,当我向下滚动到页面底部并且想要查看菜单时,页面会跳回到顶部。我希望在单击菜单时页面保持在当前位置。我怎样才能做到这一点?
这是使菜单进出动画的 jQuery:
$(document).ready(function(){
$("#closeIcon").hide()
});
$(document).ready(function(){
$("#menuIcon").click(function(){
$(".left").animate({width:'10%'}, "500");
$(".right").animate({width:'90%'}, "500");
$("#nav").animate({
left: '30%',
}, "500" );
$("#menuIcon").fadeOut(500)
$("#closeIcon").fadeIn(500)
});
});
$(document).ready(function(){
$("#closeIcon").click(function(){
$(".left").animate({width:'0%'}, "500");
$(".right").animate({width:'100%'}, "500");
$("#nav").animate({
left: '0',
}, "500" );
$("#menuIcon").fadeIn(500)
$("#closeIcon").fadeOut(500)
});
});
Run Code Online (Sandbox Code Playgroud)
菜单本身位于页面外,单击时它会滑入并调整主页面的大小。