Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.05 KB

README.md

File metadata and controls

31 lines (22 loc) · 1.05 KB

Simple jQuery Tabs

This is very simple jQuery tabs plugin made mostly when learning coffee-script and jasmine.

Installation

Download jquery-tabs.min.js or jquery-tabs.js and put into your's scripts.

To enable plugin your tabs list elements needs data-target attribute with id of target panel, eg.:

<ul class="tabs">
  <li data-panel="panel-1"><a href="#">tab 1</a></li>
  <li data-panel="panel-2"><a href="#">tab 2</a></li>
</ul>
<div id="panel-1">content</div>
<div id="panel-2">content</div>

Then add on document load $(".tabs").tabs() and... that's all!

When you want to load panel content via ajax, set data-remote="true" attribute on the specific tab. Plugin will use anchor url to load the content.

Requirements

jQuery 1.6 or newer