|
1 |
| -# pwstabs |
2 |
| -jQuery Tabs Plugin |
| 1 | +# PWS Tabs jQuery Plugin |
| 2 | + |
| 3 | +jQuery Plugin to create tabs. |
| 4 | + |
| 5 | +All you need to do is add few divs for your tabs, and script will generate Tabs for you. |
| 6 | + |
| 7 | +## Demo |
| 8 | + |
| 9 | +You can check out online demo at http://alexchizhov.com/pwstabs |
| 10 | + |
| 11 | + |
| 12 | +## Documentation |
| 13 | + |
| 14 | +### Getting Started |
| 15 | + |
| 16 | +All you really need to do is to create a DIV block, with DIV blocks in it and add DATA attributes. |
| 17 | + |
| 18 | +1) Lets create main DIV: |
| 19 | +<pre><code><div class="hello_world"></div></code></pre> |
| 20 | + |
| 21 | +<br> |
| 22 | + |
| 23 | +2) Lets say we want 3 tabs, lets create three DIVs and add DATA attributes like so: |
| 24 | +<pre><code><div class="hello_world"> |
| 25 | + |
| 26 | + <div data-pws-tab="anynameyouwant1" data-pws-tab-name="Tab Title 1">Our first tab</div> |
| 27 | + <div data-pws-tab="anynameyouwant2" data-pws-tab-name="Tab Title 2">Our second tab</div> |
| 28 | + <div data-pws-tab="anynameyouwant3" data-pws-tab-name="Tab Title 3">Our third tab</div> |
| 29 | + |
| 30 | +</div></code></pre> |
| 31 | + |
| 32 | + |
| 33 | +<strong>data-pws-tab</strong> is used to initiate the tab and as its ID. |
| 34 | + |
| 35 | +<strong>data-pws-tab-name</strong> is used for a tab display name. Tabs are created automaticaly with this name! |
| 36 | + |
| 37 | + |
| 38 | +### Include Plugin Files |
| 39 | + |
| 40 | +Just place plugins files into <strong><head></strong> section. <strong>Plugin requires jQuery!</strong> |
| 41 | + |
| 42 | +<pre><code><!-- Include jQuery if needed --> |
| 43 | +<script src="//code.jquery.com/jquery-1.11.2.min.js"></script> |
| 44 | + |
| 45 | +<link type="text/css" rel="stylesheet" href="jquery.pwstabs.css"> |
| 46 | +<script src="jquery.pwstabs-1.1.0.js"></script></code></pre> |
| 47 | + |
| 48 | + |
| 49 | +### Initiate Plugin |
| 50 | + |
| 51 | +<pre><code>jQuery(document).ready(function($){ |
| 52 | + $('#tabset0').pwstabs(); |
| 53 | +});</code></pre> |
| 54 | + |
| 55 | + |
| 56 | +### Initiate Plugin With Options |
| 57 | +<pre><code>jQuery(document).ready(function($){ |
| 58 | + $('.tabset1').pwstabs({ |
| 59 | + effect: 'scale', |
| 60 | + defaultTab: 3, |
| 61 | + containerWidth: '600px' |
| 62 | + }); |
| 63 | +});</code></pre> |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +### Options |
| 68 | + |
| 69 | +<table> |
| 70 | +<thead> |
| 71 | +<tr> |
| 72 | +<th>Option</th> |
| 73 | +<th>Default</th> |
| 74 | +<th>Description</th> |
| 75 | +<th>Available options</th> |
| 76 | +</tr> |
| 77 | +</thead> |
| 78 | +<tbody> |
| 79 | +<tr> |
| 80 | +<td>effect</td> |
| 81 | +<td>scale</td> |
| 82 | +<td>Transition effect</td> |
| 83 | +<td>scale / slideleft / slideright / slidetop / slidedown</td> |
| 84 | +</tr> |
| 85 | +<tr> |
| 86 | +<td>defaultTab</td> |
| 87 | +<td>1</td> |
| 88 | +<td>Which tab is chosen by default</td> |
| 89 | +<td>Tab ID number starts with 1 (1,2,3..)</td> |
| 90 | +</tr> |
| 91 | +<tr> |
| 92 | +<td>containerWidth</td> |
| 93 | +<td>100%</td> |
| 94 | +<td>Tabs container width</td> |
| 95 | +<td>Any size value (1,2,3.. / px,pt,em,%,cm..)</td> |
| 96 | +</tr> |
| 97 | +</tbody> |
| 98 | +</table> |
0 commit comments