小编PhD*_*hDJ的帖子

jQueryUI选项卡:选中选项卡时,清除其他选项卡的div

我有一个页面,其中有几个显示类似内容的选项卡,以确保我在正确的选项卡中访问正确的字段,我想在用户单击选项卡时立即清除其他选项卡的div的内容.

这是我使用的代码:

<!doctype html>

<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>WebShop</title>
     <link rel="stylesheet" type="text/css" href="/includes/igepa.css" />
     <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
     <link rel="stylesheet" href="/resources/demos/style.css" />


    <script src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>    

    <script>
    $(function() {
        $( "#tabs" ).tabs({
            beforeLoad: function( event, ui ) {
                ui.jqXHR.error(function() {
                    ui.panel.html(
                        "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                        "If this wouldn't be a demo." );
                });
            },
            load: function(event, ui){
               $('.ui-tabs-hide').empty();  
            }                          
        });
    });
    </script>
</head>
<body>

<div id="tabs">
    <ul> …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui jquery-ui-tabs

1
推荐指数
1
解决办法
5145
查看次数

标签 统计

jquery ×1

jquery-ui ×1

jquery-ui-tabs ×1