0

問題があります。クリックアクションを少しの間ブロック/シャットダウンする必要があります。私がやろうとしているのは、クリック後にすべてのアクションを実行することですが、このアクションが進行中の場合は、このクリックをブロックします。だからこれは私のコードです、助けのためのthx:

carousel_controls_buttons.live('click', function(e){
    carousel_controls_buttons.attr('disabled', 'disabled');
    setTimeout(function(){
        e.preventDefault();
        $(xml).find("main_menu").each(function (){
           // some actions
        });
        carousel_controls_buttons.removeAttr('disabled');
    }, 450);
});
4

1 に答える 1

0

私はあなたがこのようなものを望んでいると推測しています:

$(document).ready(function () {
    carousel_controls_buttons.attr('disabled', 'disabled');
    setTimeout(function(){
        carousel_controls_buttons.removeAttr('disabled');
    }, 1000);

    carousel_controls_buttons.live('click', function(e){
        e.preventDefault();
        $(xml).find("main_menu").each(function (){
        // some actions
        });
    });
});
于 2013-01-22T16:15:28.810 に答える