Débora
Débora

Reputation: 5952

jQuery tab pane

I referred this and downoaded jquery-ui-1.8.19.custom library (all 31 components as mentioned in here)

I followed the sample code. But it didn't work. Here is my full code.

    <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>

I don't need any css styles. I need only a working simple tab pane and I can improve later. I put $( "#tabs" ).tabs(); in the body tag inside a </script> tag. it also didn't work. Any one can let me know where I have missed or where the problem is.

Upvotes: 0

Views: 708

Answers (2)

D&#233;bora
D&#233;bora

Reputation: 5952

adding http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css solved the problem.

Upvotes: 0

Ghokun
Ghokun

Reputation: 3465

You forgot to add related css like:

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

Upvotes: 1

Related Questions