嘿家伙我有这个jQuery代码的问题。其实它工作正常,但我不能关闭div后滚动我的滚轮。JQuery启用和禁用滚动
$(document).ready(function() {
$("#add_item_inventory_toggle").click(function() {
$("#add_item_inventory").fadeOut("fast");
$("#add_item_inventory_toggle").hide();
$('body').off('scroll mousewheel touchmove', function(e) {
e.preventDefault();
e.stopPropagation();
return false;
});
});
$("#inventory_content_add_items").click(function() {
$("#add_item_inventory").fadeIn("fast");
$("#add_item_inventory_toggle").show();
$('body').on('scroll mousewheel touchmove', function(e) {
e.preventDefault();
e.stopPropagation();
return false;
});
});
});
感谢您的快速响应,它的作品非常好! :D – VeloFX
你很欢迎!乐于帮助。祝你好运! – AtheistP3ace