簡體   English   中英

jQuery選項卡窗格

[英]jQuery tab pane

我引用了這個版本,並對其進行了貶義的jquery-ui-1.8.19.custom庫( 這里提到的所有31個組件)

我遵循了示例代碼。 但這沒有用。 這是我的完整代碼。

    <html>
    <head>
    <meta charset="utf-8">
    <title>jQuery UI Tabs - Default functionality</title>
        <script type="text/javascript" src="1_6js.js"></script>// this is 1.6 jQuery pluging and it works well in other pages    
        <script type="text/javascript" src="jquery-ui-1.8.19.custom.min.js"></script>  // this is my jquery ui plugin

    <script>
    $(function() {

                alert("hi")  // this alert showed in browser

        $( "#tabs" ).tabs();
                alert("oh") // this alert is also showed.
    });
    </script>
</head>
<body>

<div class="demo">

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">tab 1</a></li>
        <li><a href="#tabs-2">tab 2</a></li>
        <li><a href="#tabs-3">tab 3</a></li>
    </ul>
    <div id="tabs-1">
        Content 1
    </div>
    <div id="tabs-2">
        Content 2
    </div>
    <div id="tabs-3">
        Content 3

    </div>
</div>

</div><!-- End demo -->

</body>
</html>

我不需要任何CSS樣式。 我只需要一個工作簡單的選項卡窗格,以后就可以改進。 我把$( "#tabs" ).tabs(); 在</ script>標記內的body標記中。 它也沒有用。 任何人都可以讓我知道我錯過了哪里或問題出在哪里。

您忘記添加相關的CSS,例如:

<link rel="stylesheet" href="/css/custom-theme/jquery-ui-1.8.19.custom.css" type="text/css" />

添加http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css解決了該問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM