NullPoiиteя
NullPoiиteя

Reputation: 57342

jQuery tab not working

I am creating the tab using jQuery:

$("document").ready(function() {
    $("#tabs").tabs();
});

and the html:

<div id="tabs">
<ul>
        <li><a href="#tabs-1">Nunc tincidunt</a></li>
        <li><a href="#tabs-2">Proin dolor</a></li>
        <li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
        <p>Proin ur nec arcu m sodal mpus lectus.</p>
</div>
<div id="tabs-2">
        <p> llus p Mauris consectetur tortor et purus.</p>
</div>
<div id="tabs-3">
        <p> sus he  nec, luctus a, lacus.</p>

</div>
</div>

css:

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css">

and the jQuery I have included is:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>

but the tab is not working?

Upvotes: 1

Views: 3610

Answers (1)

Ahsan Khurshid
Ahsan Khurshid

Reputation: 9469

Remove double quotes from $("document")

It should be:

$(document).ready(function() {
    $("#tabs").tabs();
});

Or Try with:

$(function(){
    $("#tabs").tabs();
})

EDITED:

Suggestion Note: If everything is fine then these type of errors may occur while you are using any other library like prototype then it is being conflicting with jQuery library, to remove conflicts you've to go through with jQuery.noConflict( [removeAll] ).

See reference for implementation: jQuery.noConflict

Upvotes: 2

Related Questions