0

I am totaly new to JQUERY and i have got a project in which i have to use JQUERY UI tabs i downloaded one UI tab and followed all the instructions that are listed on here my html code is:

   <div id="tab">
    <ul class="tabs">
        <li><a href="#tabs-1">Tab1</a></li>
        <li><a href="#tabs-2">Tab2</a></li>
        <li><a href="#tabs-3">Tab3</a></li>
    </ul> 
    <div class="tab-content" id="tabs1">Tab1</div>
    <div class="tab-content" id="tabs2">Tab2</div>
    <div class="tab-content" id="tabs3">Tab3</div> </div>

and my JQUERY function is :

    <script type="text/javascript">

    $(document).ready(function () {
        $('#tab').tabs();
    });
</script>

The problem is that when i run the page it shows the output as follows: this

and i CAN NOT NAVIGATE WITH TABS... I will heighly appreciate your kind help in this regard

Thanks in advance and looking for your prompt help

1
  • Check your console. Do you see Uncaught jQuery UI Tabs: Mismatching fragment identifier. ? Commented Jul 21, 2012 at 5:40

2 Answers 2

3

The links in the tab buttons:

<li><a href="#tabs-1">Tab1</a></li>
<li><a href="#tabs-2">Tab2</a></li>
<li><a href="#tabs-3">Tab3</a></li>

need to match the id attributes of the tabs. Your links use tabs-1, tabs-2, and tabs-3 but your tabs use tabs1, tabs2, and tabs3.

Demo: http://jsfiddle.net/ambiguous/kbfjS/

Sign up to request clarification or add additional context in comments.

6 Comments

AWESOME and thank you so much for the help it is fixed now :)
Again another problem i am facing in this issue, when a post back occurs on any of the tabs the tab is reloaded from beging and the first tab comes even if i call an event on the other tabs, the selected tab is not reloading after postback; how to solve this one? please help me ..thanks in advance
I solved the above issue by using cookie function of jquery ui tabs, but now the problem is even after closing and loading the page back instead of default tab the last selected tab comes, now am totaly stack and badly need your help in this regard..
@Hardworker: You could adjust the post-back to keep track of the open tab or delete the cookie after it has served its purpose.
I found the solution, instead of using cookie i used hiddenfield to keep track of tab indicies..anyways thanks
|
0

Rename the content div's to this, you for got the dash -.

<div class="tab-content" id="tabs-1">Tab1</div>
<div class="tab-content" id="tabs-2">Tab2</div>
<div class="tab-content" id="tabs-3">Tab3</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.