tags:

views:

39

answers:

1

Which is the best unobtrusive and lightweight jquery solution to make tab? Although Jquery similar to jquery ui. jquery ui tab is good but it's overkill fro for just tab. we will have to add jquery ui core.js, jquery ui tab.js then a little code snippet.

I need lightweight solution. using this type HTML. and jquery code should be in no.conflict mode.

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

tabs content should be accessible if js is disabled.

+1  A: 

If changing your HTML is an option you'd be better off with going something a bit more semantic. Having semantic markup for your tabs will result in better search engine optimization and make your site more accessible to a wider range of users. That said a Semantic Tabs with jQuery is a great plugin that will work with the below markup.

<div id="mytabset">
  <div class="panel">
    <h3>Tab1</h3>
     Panel stuff 1
  </div>
  <div class="panel">
    <h3>Tab2</h3>
     Panel stuff 2
  </div>
  <div class="panel">
    <h3>Tab3</h3>
     Panel stuff 3
  </div>
</div>
ahsteele
but tab is a navigation to access content. but thanks for this info +1
metal-gear-solid
you are right when js would be disabled then this code would be more accessible
metal-gear-solid
@metal-gear-solid Maybe I misunderstood your question but the content is accessible this way with JavaScript disabled and is in the best possible format for doing so.
ahsteele
@ahsteele - you are right. agree. btw this is also similar http://blog.mozmonkey.com/2007/semantic-tab-box-v20/
metal-gear-solid