1

jquery ui バージョン 1.10.2 で効果を動作させようとしています。私の html ページを以下に示します。タブは機能しますが、ブラインド効果は発生しません。私は何を間違っていますか?

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tabs</title>
<link rel="stylesheet" href="css/smoothness/jquery-ui-1.10.2.custom.css">
</head>
<body>
<div id="myTabs">
    <ul>
        <li><a href="#a">Tab 1</a></li>
        <li><a href="#b">Tab 2</a></li>
    </ul>
    <div id="a">This is the content panel linked to the first tab, it is shown by default.</div>
    <div id="b">This is the content panel linked to the second tab, it is shown when its tab is clicked.</div>  
</div>
<script type="text/javascript" src="development-bundle/jquery-1.9.1.js"></script>
<script type="text/javascript" src="development-bundle/ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="development-bundle/ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="development-bundle/ui/jquery.ui.tabs.js"></script>
<script type="text/javascript">
    (function($) {
        var tabOpts = {
            hide: {
                effect: "blind",
                duration: 2000
            },
            show: {
                effect: "blind",
                duration: 2000
            }

        };
        $("#myTabs").tabs(tabOpts);
    })(jQuery);
</script>
</body>
</html>    
4

1 に答える 1

1

その理由は、部分的な jQuery UI バージョンを含めているためです。

jQuery UI タブで、効果のある表示/非表示を有効blindにするには、jQuery UIeffectsコンポーネントhttp://api.jqueryui.com/category/effects/を含める必要があります。

ページhttp://api.jqueryui.com/tabs/を参照し、依存関係のセクションを読んでください。

UI コア
ウィジェット ファクトリ
エフェクト コア (オプション。表示オプションと非表示オプションで使用)

最後のコメントのように、jQuery UI 全体を含めると、すべてのライブラリが含まれているため機能します。

于 2013-05-04T09:27:19.117 に答える