禁用鼠标滚轮滚动/或任何滚动Jquery



我有一个情况,我想禁用滚动,而数据通过Ajax加载。

I have try:-

jQuery.ajax({
    type: 'POST',
    url: '<?php echo get_site_url();?>/wp-admin/admin-ajax.php',
    data: {
        action: 'my_cat_page',
        bar: bids,
        price: pids,
        catid: ids,
        status: both,
        area: zids,
        cuis: cids,
        noc: noc
    },
    beforeSend: function () {
        jQuery('#TB_overlay').css('display', 'block');
        jQuery(window).scroll().disable();
    },    
    complete: function () {
        jQuery('#TB_overlay').css('display', 'none');
        jQuery("#right_search").html(html);
    },
    success: function (html) {
        jQuery("#right_search").html(html);
        jQuery(window).scroll().enable();
    },   
    failure: function (html) {
        jQuery("#right_search").html("Ajax Failure! Please try again.");
    }    
}); 

运气不好

试试这个:

$(document).ready(function () {
    $(document).ajaxStart(function () {
        $("body").css("overflow","hidden");
    }).ajaxStop(function () {
        $("body").css("overflow","auto");
    });
});

注释掉所有的jQuery(window).scroll().disable() & enable();代码

相关内容

最新更新