2

タイトルで述べたように、jquery ui タブを削除したり、少なくとも前に確認を求めたりしないようにしたいと思います。

私は試した

$( "#tabs" ).bind( "tabsremove", function(event, ui) {
        var ok=confirm("Are you sure you want to close this tab ?");
        if (ok) {
            return true;
        } else {
            return false;
        };
     });

また

$( "#tabs" ).bind( "tabsremove", function(event, ui) {
        var ok=confirm("Are you sure you want to close this tab ?");
        if (ok) {
            return true;
        } else {
            return false;
        };
     });

しかし、質問は私が望むように前ではなく、後で尋ねられます。これは可能ですか?

4

1 に答える 1

0

これはあなたが意味するものですか?

$( "#tabs span.ui-icon-close" ).live( "click", function() {
        var ok=confirm("Are you sure you want to close this tab ?");
        if (ok) {
            var index = $( "li", $tabs ).index( $( this ).parent() );
            $tabs.tabs( "remove", index );
        } else {
            return false;
        };

これはjQuery-ui-tabsからのものです

于 2012-10-03T06:52:41.547 に答える