Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | Twitter Bootstrap Wizard |
| 2 | ============================ |
||
| 3 | |||
| 4 | This Twitter Bootstrap plugin builds a wizard using a formatted tabbable structure. It allows to build a wizard functionality using buttons to go through the different wizard steps and using events allows to hook into each step individually. |
||
| 5 | |||
| 6 | <a href="http://vadimg.com/twitter-bootstrap-wizard-example/" target="_blank">Website & Demo</a> |
||
| 7 | |||
| 8 | <a href='https://twitter.com/gabrielva' target='_blank'>Follow @gabrielva</a> |
||
| 9 | |||
| 10 | Requirements |
||
| 11 | ------------- |
||
| 12 | |||
| 13 | * Requires jQuery v1.3.2 or later |
||
| 14 | * Bootstrap 2.2.x, 2.3.x, 3.0 |
||
| 15 | |||
| 16 | Code Examples |
||
| 17 | ------------- |
||
| 18 | |||
| 19 | ```javascript |
||
| 20 | //basic wizard |
||
| 21 | $(document).ready(function() { |
||
| 22 | $('#rootwizard').bootstrapWizard(); |
||
| 23 | }); |
||
| 24 | ``` |
||
| 25 | |||
| 26 | ```javascript |
||
| 27 | //wizard with options and events |
||
| 28 | $(document).ready(function() { |
||
| 29 | $('#rootwizard').bootstrapWizard({ |
||
| 30 | tabClass: 'nav nav-pills', |
||
| 31 | onNext: function(tab, navigation, index) { |
||
| 32 | alert('next'); |
||
| 33 | } |
||
| 34 | }); |
||
| 35 | }); |
||
| 36 | ``` |
||
| 37 | |||
| 38 | ```javascript |
||
| 39 | //calling a method |
||
| 40 | $('#rootwizard').bootstrapWizard('show',3); |
||
| 41 | ``` |
||
| 42 | |||
| 43 | Options |
||
| 44 | ------- |
||
| 45 | <table class="table table-bordered table-striped"> |
||
| 46 | <thead> |
||
| 47 | <tr> |
||
| 48 | <th>Key</th> |
||
| 49 | <th>Default</th> |
||
| 50 | <th>Description</th> |
||
| 51 | </tr> |
||
| 52 | </thead> |
||
| 53 | <tbody> |
||
| 54 | <tr> |
||
| 55 | <td>tabClass</td> |
||
| 56 | <td>'nav nav-pills'</td> |
||
| 57 | <td>ul navigation class</td> |
||
| 58 | </tr> |
||
| 59 | <tr> |
||
| 60 | <td>nextSelector</td> |
||
| 61 | <td>'.wizard li.next'</td> |
||
| 62 | <td>next element selector</td> |
||
| 63 | </tr> |
||
| 64 | <tr> |
||
| 65 | <td>previousSelector</td> |
||
| 66 | <td>'.wizard li.previous'</td> |
||
| 67 | <td>previous element selector</td> |
||
| 68 | </tr> |
||
| 69 | <tr> |
||
| 70 | <td>firstSelector</td> |
||
| 71 | <td>'.wizard li.first'</td> |
||
| 72 | <td>first element selector</td> |
||
| 73 | </tr> |
||
| 74 | <tr> |
||
| 75 | <td>lastSelector</td> |
||
| 76 | <td>'.wizard li.last'</td> |
||
| 77 | <td>last element selector</td> |
||
| 78 | </tr> |
||
| 79 | </tbody> |
||
| 80 | </table> |
||
| 81 | |||
| 82 | Events |
||
| 83 | ------ |
||
| 84 | <table class="table table-bordered table-striped"> |
||
| 85 | <thead> |
||
| 86 | <tr> |
||
| 87 | <th>Key</th> |
||
| 88 | <th>Description</th> |
||
| 89 | </tr> |
||
| 90 | </thead> |
||
| 91 | <tbody> |
||
| 92 | <tr> |
||
| 93 | <td>onInit</td> |
||
| 94 | <td>Fired when plugin is initialized</td> |
||
| 95 | </tr> |
||
| 96 | <tr> |
||
| 97 | <td>onShow</td> |
||
| 98 | <td>Fired when plugin data is shown</td> |
||
| 99 | </tr> |
||
| 100 | <tr> |
||
| 101 | <td>onNext</td> |
||
| 102 | <td>Fired when next button is clicked (return false to disable moving to the next step)</td> |
||
| 103 | </tr> |
||
| 104 | <tr> |
||
| 105 | <td>onPrevious</td> |
||
| 106 | <td>Fired when previous button is clicked (return false to disable moving to the previous step)</td> |
||
| 107 | </tr> |
||
| 108 | <tr> |
||
| 109 | <td>onFirst</td> |
||
| 110 | <td>Fired when first button is clicked (return false to disable moving to the first step)</td> |
||
| 111 | </tr> |
||
| 112 | <tr> |
||
| 113 | <td>onLast</td> |
||
| 114 | <td>Fired when last button is clicked (return false to disable moving to the last step)</td> |
||
| 115 | </tr> |
||
| 116 | <tr> |
||
| 117 | <td>onTabChange</td> |
||
| 118 | <td>Fired when a tab is changed (return false to disable moving to that tab and showing its contents)</td> |
||
| 119 | </tr> |
||
| 120 | <tr> |
||
| 121 | <td>onTabClick</td> |
||
| 122 | <td>Fired when a tab is clicked (return false to disable moving to that tab and showing its contents)</td> |
||
| 123 | </tr> |
||
| 124 | <tr> |
||
| 125 | <td>onTabShow</td> |
||
| 126 | <td>Fired when a tab content is shown (return false to disable showing that tab content)</td> |
||
| 127 | </tr> |
||
| 128 | </tbody> |
||
| 129 | </table> |
||
| 130 | |||
| 131 | Methods |
||
| 132 | ------- |
||
| 133 | <table class="table table-bordered table-striped"> |
||
| 134 | <thead> |
||
| 135 | <tr> |
||
| 136 | <th>Key</th> |
||
| 137 | <th>Parameters</th> |
||
| 138 | <th>Description</th> |
||
| 139 | </tr> |
||
| 140 | </thead> |
||
| 141 | <tbody> |
||
| 142 | <tr> |
||
| 143 | <td>next</td> |
||
| 144 | <td></td> |
||
| 145 | <td>Moves to the next tab</td> |
||
| 146 | </tr> |
||
| 147 | <tr> |
||
| 148 | <td>previous</td> |
||
| 149 | <td></td> |
||
| 150 | <td>Moves to the previous tab</td> |
||
| 151 | </tr> |
||
| 152 | <tr> |
||
| 153 | <td>first</td> |
||
| 154 | <td></td> |
||
| 155 | <td>Jumps to the first tab</td> |
||
| 156 | </tr> |
||
| 157 | <tr> |
||
| 158 | <td>last</td> |
||
| 159 | <td></td> |
||
| 160 | <td>Jumps to the last tab</td> |
||
| 161 | </tr> |
||
| 162 | <tr> |
||
| 163 | <td>show</td> |
||
| 164 | <td>zero based index</td> |
||
| 165 | <td>Jumps to the specified tab</td> |
||
| 166 | </tr> |
||
| 167 | <tr> |
||
| 168 | <td>currentIndex</td> |
||
| 169 | <td></td> |
||
| 170 | <td>Returns the zero based index number for the current tab</td> |
||
| 171 | </tr> |
||
| 172 | <tr> |
||
| 173 | <td>navigationLength</td> |
||
| 174 | <td></td> |
||
| 175 | <td>Returns the number of tabs</td> |
||
| 176 | </tr> |
||
| 177 | <tr> |
||
| 178 | <td>enable</td> |
||
| 179 | <td>zero based index</td> |
||
| 180 | <td>Enables a tab, allows a user to click it (removes .disabled if the item has that class)</td> |
||
| 181 | </tr> |
||
| 182 | <tr> |
||
| 183 | <td>disable</td> |
||
| 184 | <td>zero based index</td> |
||
| 185 | <td>Disables a tab, disallows a user to click it (adds .disabled to the li element)</td> |
||
| 186 | </tr> |
||
| 187 | <tr> |
||
| 188 | <td>display</td> |
||
| 189 | <td>zero based index</td> |
||
| 190 | <td>Displays the li element if it was previously hidden</td> |
||
| 191 | </tr> |
||
| 192 | <tr> |
||
| 193 | <td>hide</td> |
||
| 194 | <td>zero based index</td> |
||
| 195 | <td>Hides the li element (will not remove it from the DOM)</td> |
||
| 196 | </tr> |
||
| 197 | <tr> |
||
| 198 | <td>remove</td> |
||
| 199 | <td>zero based index, optinal bool remove tab-pane element or not false by default</td> |
||
| 200 | <td>Removes the li element from the DOM if second argument is true will also remove the tab-pane element</td> |
||
| 201 | </tr> |
||
| 202 | </tbody> |
||
| 203 | </table> |
||
| 204 | |||
| 205 | <p>© <a href='http://vadimg.com' target="_blank">Vadim Vincent Gabriel</a> <a href='https://twitter.com/gabrielva' target='_blank'>Follow @gabrielva</a> 2012</p> |
||
| 206 | |||
| 207 | License |
||
| 208 | =============== |
||
| 209 | The MIT License (MIT) |
||
| 210 | |||
| 211 | Copyright (c) 2013 - Vincent Gabriel & Jason Gill |
||
| 212 | |||
| 213 | Permission is hereby granted, free of charge, to any person obtaining a copy |
||
| 214 | of this software and associated documentation files (the "Software"), to deal |
||
| 215 | in the Software without restriction, including without limitation the rights |
||
| 216 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||
| 217 | copies of the Software, and to permit persons to whom the Software is |
||
| 218 | furnished to do so, subject to the following conditions: |
||
| 219 | |||
| 220 | The above copyright notice and this permission notice shall be included in |
||
| 221 | all copies or substantial portions of the Software. |
||
| 222 | |||
| 223 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
| 224 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
| 225 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||
| 226 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||
| 227 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||
| 228 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||
| 229 | THE SOFTWARE. |
||
| 230 | |||
| 231 |