slideToggle 对我的 ul slideToggle 有橡皮筋效果(jQuery 帮助)
slideToggle has a rubber band effect on my ul slideToggle (jQuery help)
当 window 浏览器小于 600p
x 时,我的移动菜单具有 jquery slideToggle 功能。但是,当单击该图标时,它会向下滑动 ul
,但会立即向上滑动。
这就是我要说的
这行得通
$('#trigger').click(function() {
$('#nav-menu').slideToggle(400, function() {
//$(this).toggleClass('.trigger-expand').css('display', '');
});
});
只需评论或删除此行:
$(this).toggleClass('.trigger-expand').css('display', '');
现在,如果您想在浏览器大小发生变化且大于 600px
时更改一些 css,请使用此方法:
$(window).on('resize', function(){
var win = $(this); //this = window
if (win.width() > 600) {
/* The window is larger than 600px
change you css style here */
}
});
当 window 浏览器小于 600p
x 时,我的移动菜单具有 jquery slideToggle 功能。但是,当单击该图标时,它会向下滑动 ul
,但会立即向上滑动。
这就是我要说的
这行得通
$('#trigger').click(function() {
$('#nav-menu').slideToggle(400, function() {
//$(this).toggleClass('.trigger-expand').css('display', '');
});
});
只需评论或删除此行:
$(this).toggleClass('.trigger-expand').css('display', '');
现在,如果您想在浏览器大小发生变化且大于 600px
时更改一些 css,请使用此方法:
$(window).on('resize', function(){
var win = $(this); //this = window
if (win.width() > 600) {
/* The window is larger than 600px
change you css style here */
}
});