views:

261

answers:

1

Hello all,

I’ve got a requirement to create tabs for content displayed on a web page, so that a user doesn’t have to scroll vertically to read all the content.

Is there a way for jQuery to automatically divide page content into chunks and wrap that into tabs? I’m sure I saw something somewhere once…

+3  A: 

jQuery UI tabs plugin is what you need.

Example:

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

<div id="example">
     <ul>
         <li><a href="ahah_1.html"><span>Content 1</span></a></li>
         <li><a href="ahah_2.html"><span>Content 2</span></a></li>
         <li><a href="ahah_3.html"><span>Content 3</span></a></li>
     </ul>
</div>
karim79
The user creating the content would have to be familiar with html for this solution to work?
Rob
Really depends on the implementation. I would suggest checking out the examples on the link provided, I could paste them here but there doesn't seem to be much point.
karim79
cool, thanks. I'll have a look through the examples.
Rob