0

Background : my code uses master page which has frames inside and all the other navigation happens using frame and master page is used for menu purpose. On submit button click (on all screen) , want to disable page for any further user interference. For that master page has a div and on individual page following code is written

var loading = window.parent.document.getElementById('dvLoading');
$(loading).show();

Problem: i have one frame which has couple ajax tab, on clicking on individual tab , i would like to call same div to prevent user interference while tab navigation. for which following code is written

$(".ajax__tab_inner").click(function() {
     var loading = window.parent.document.getElementById('dvLoading');
     $(loading).show();
});

This works fine untill user clicks on currently active tab, which does not remove the loading div and it remains loaded/hanging state.

kindly suggest how to prevent div loading for active tab or any other way.

4

1 回答 1

0

您应该检查单击的选项卡是否是当前选项卡,如果是,请取消其余代码。

这是这种方式的示例代码:

 $(".ajax__tab_inner").click(function() {
             // assuming that the active tab has a class called `active`
             if((this).hasClass('.active')) 
                 {
                     return false;
                 }
            var loading = window.parent.document.getElementById('dvLoading');
            $(loading).show();
        });
于 2012-09-09T01:34:59.097 回答