index.html 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Bootstrap Tour, easy product tours with Bootstrap from Twitter</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link href="assets/vendor/bootstrap.min.css" rel="stylesheet">
  8. <!-- <link href="assets/vendor/bootstrap-theme.min.css" rel="stylesheet"> -->
  9. <link href="assets/vendor/prism.css" rel="stylesheet">
  10. <link href="assets/css/bootstrap-tour.css" rel="stylesheet">
  11. <link href="assets/css/index.css" rel="stylesheet">
  12. <!--[if lt IE 9]><script src="assets/vendor/html5shiv.js"></script><![endif]-->
  13. </head>
  14. <body>
  15. <a href="https://github.com/sorich87/bootstrap-tour" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
  16. <div id="navbar" class="navbar navbar-inverse navbar-fixed-top">
  17. <div class="container">
  18. <button type="button" class="navbar-toggle pull-right" data-toggle="collapse" data-target=".navbar-collapse">
  19. <span class="icon-bar"></span>
  20. <span class="icon-bar"></span>
  21. <span class="icon-bar"></span>
  22. </button>
  23. <a href="/" class="navbar-brand">Bootstrap Tour</a>
  24. <h4 class="navbar-text pull-right">
  25. <a href="http://getbootstrap.com" target="_blank" class="label label-info">Bootstrap 3 ready!</a>
  26. </h4>
  27. <div class="collapse navbar-collapse">
  28. <ul class="navbar-nav nav">
  29. <li>
  30. <a href="#usage">Usage</a>
  31. </li>
  32. <li class="dropdown">
  33. <a href="#" class="dropdown-toggle" data-toggle="dropdown">Options <span class="caret"></span></a>
  34. <ul class="dropdown-menu">
  35. <li>
  36. <a href="#options">Tour options</a>
  37. </li>
  38. <li>
  39. <a href="#step-options">Step options</a>
  40. </li>
  41. </ul>
  42. </li>
  43. <li>
  44. <a href="#methods">Methods</a>
  45. </li>
  46. <li>
  47. <a href="#contributing">Contributing</a>
  48. </li>
  49. <li>
  50. <a href="#license">License</a>
  51. </li>
  52. </ul>
  53. </div>
  54. </div>
  55. </div>
  56. <header id="home">
  57. <div class="jumbotron masthead">
  58. <h1 id="reflex">Bootstrap Tour</h1>
  59. <p>Quick and easy way to build your product tours with Twitter Bootstrap Popovers.</p>
  60. <p>
  61. <a href="https://github.com/sorich87/bootstrap-tour/archive/master.zip" id="download" class="btn-primary btn-large btn"><span class="glyphicon glyphicon-download"></span> Download</a>
  62. <button type="button" id="demo" class="btn btn-default" data-demo><span class="glyphicon glyphicon-play"></span> Demo</button>
  63. </p>
  64. <ul class="masthead-links">
  65. <li>
  66. <a href="http://github.com/sorich87/bootstrap-tour">GitHub project</a>
  67. </li>
  68. <li>
  69. Version 0.8.0
  70. </li>
  71. <li>
  72. Bootstrap version &lt;= 3.0.0
  73. </li>
  74. </ul>
  75. </div>
  76. </header>
  77. <section id="usage">
  78. <div class="container">
  79. <div class="page-header">
  80. <h2>Usage <small>Oh wait, is it so simple?</small></h2>
  81. </div>
  82. <h3>Add the dependencies</h3>
  83. <pre class="language-markup"><code>&lt;!DOCTYPE html&gt;
  84. &lt;html&gt;
  85. &lt;head&gt;
  86. ...
  87. &lt;link href="bootstrap-tour.css" rel="stylesheet"&gt;
  88. &lt;!--[if lt IE 9]&gt;&lt;script src="html5shiv.js"&gt;&lt;![endif]--&gt;
  89. &lt;/head&gt;
  90. &lt;body&gt;
  91. ...
  92. &lt;script src="jquery.js"&gt;&lt;/script&gt;
  93. &lt;script src="bootstrap.tooltip.js"&gt;&lt;/script&gt;
  94. &lt;script src="bootstrap.popover.js"&gt;&lt;/script&gt;
  95. &lt;script src="bootstrap-tour.js"&gt;&lt;/script&gt;
  96. &lt;/body&gt;
  97. &lt;/html&gt;</code></pre>
  98. <h3>Setup your tour</h3>
  99. <pre class="language-javascript"><code>// Instance the tour
  100. var tour = new Tour();
  101. // Add your steps. Not too many, you don't really want to get your users sleepy
  102. tour.addSteps([
  103. {
  104. element: "#my-element", // string (jQuery selector) - html element next to which the step popover should be shown
  105. title: "Title of my step", // string - title of the popover
  106. content: "Content of my step" // string - content of the popover
  107. },
  108. {
  109. element: "#my-other-element",
  110. title: "Title of my step",
  111. content: "Content of my step"
  112. }
  113. ]);
  114. // Initialize the tour
  115. tour.init();
  116. // Start the tour
  117. tour.start();</code></pre>
  118. </div>
  119. </section>
  120. <section id="options">
  121. <div class="container">
  122. <div class="page-header">
  123. <h2>Options <small>Well, let's go deeper</small></h2>
  124. </div>
  125. <h3 id="tour-options">Tour options</h3>
  126. <pre class="language-javascript"><code>var tour = new Tour({
  127. name: "tour",
  128. container: "body",
  129. keyboard: true,
  130. storage: window.localStorage,
  131. debug: false,
  132. backdrop: false,
  133. redirect: true,
  134. orphan: false,
  135. duration: false,
  136. basePath: "",
  137. template: "&lt;div class='popover tour'&gt;
  138. &lt;div class='arrow'&gt;&lt;/div&gt;
  139. &lt;h3 class='popover-title'&gt;&lt;/h3&gt;
  140. &lt;div class='popover-content'&gt;&lt;/div&gt;
  141. &lt;div class='popover-navigation'&gt;
  142. &lt;button class='btn btn-default' data-role='prev'&gt;&laquo; Prev&lt;/button&gt;
  143. &lt;span data-role='separator'&gt;|&lt;/span&gt;
  144. &lt;button class='btn btn-default' data-role='next'&gt;Next &raquo;&lt;/button&gt;
  145. &lt;/div&gt;
  146. &lt;button class='btn btn-default' data-role='end'&gt;End tour&lt;/button&gt;
  147. &lt;/nav&gt;
  148. &lt;/div&gt;",
  149. afterGetState: function(key, value) {},
  150. afterSetState: function(key, value) {},
  151. afterRemoveState: function(key, value) {},
  152. onStart: function(tour) {},
  153. onEnd: function(tour) {},
  154. onShow: function(tour) {},
  155. onShown: function(tour) {}
  156. onHide: function(tour) {},
  157. onHidden: function(tour) {},
  158. onNext: function(tour) {},
  159. onPrev: function(tour) {},
  160. onPause: function(tour, duration) {},
  161. onResume: function(tour, duration) {}
  162. });</code></pre>
  163. <table class="table table-bordered table-striped">
  164. <thead>
  165. <tr>
  166. <th>Name</th>
  167. <th>Type</th>
  168. <th>Description</th>
  169. <th>Default</th>
  170. </tr>
  171. </thead>
  172. <tbody>
  173. <tr>
  174. <td>name</td>
  175. <td>String</td>
  176. <td>This option is used to build the name of the
  177. storage item where the tour state is stored. You can
  178. initialize several tours with different names in the same page and
  179. application.</td>
  180. <td><code class="language-javascript">'tour'</code></td>
  181. </tr>
  182. <tr>
  183. <td>container</td>
  184. <td>String</td>
  185. <td>Appends the step popover to a specific element.<br>
  186. <em>See Usage section of
  187. <a href="http://twitter.github.io/bootstrap/javascript.html#popovers" target="_blank">Popover</a>.
  188. </em>
  189. </td>
  190. <td><code class="language-javascript">'body'</code></td>
  191. </tr>
  192. <tr>
  193. <td>keyboard</td>
  194. <td>Boolean</td>
  195. <td>This option set the left and right arrow navigation.</td>
  196. <td><code class="language-javascript">true</code></td>
  197. </tr>
  198. <tr>
  199. <td>storage</td>
  200. <td>Object</td>
  201. <td>The storage system you want to use. could be the objects window.localStorage,
  202. window.sessionStorage or your own object.<br>
  203. You can set this option as
  204. <code class="language-javascript">false</code> to disable storage
  205. persistence (the tour starts from beginning everytime the page is
  206. loaded).<br>
  207. <em>Read more about <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage" target="_blank">DOM Storage interfaces</a>.</em>
  208. </td>
  209. <td><code class="language-javascript">window.localStorage</code></td>
  210. </tr>
  211. <tr>
  212. <td>debug</td>
  213. <td>Boolean</td>
  214. <td>Set this option to true to have some useful informations printed in the
  215. console.</td>
  216. <td><code class="language-javascript">false</code></td>
  217. </tr>
  218. <tr>
  219. <td>backdrop</td>
  220. <td>Boolean</td>
  221. <td>Show a dark backdrop behind the popover and its element,
  222. highlighting the current step.</td>
  223. <td><code class="language-javascript">false</code></td>
  224. </tr>
  225. <tr>
  226. <td>redirect</td>
  227. <td>Boolean|Function</td>
  228. <td>Set a custom function to execute as redirect function.
  229. The default redirect relies on the traditional
  230. <code class="language-javascrip">document.location.href</code></td>
  231. <td><code class="language-javascript">true</code></td>
  232. </tr>
  233. <tr>
  234. <td>orphan</td>
  235. <td>Boolean</td>
  236. <td>Allow to show the step regardless whether its element is not set, is
  237. not present in the page or is hidden. The step is fixed
  238. positioned in the middle of the page.</td>
  239. <td><code class="language-javascript">false</code></td>
  240. </tr>
  241. <tr id="duration" class="success">
  242. <td>duration <span class="label label-success">NEW</span></td>
  243. <td>Boolean|String</td>
  244. <td>Set a expiration time for the steps. When the current step expires,
  245. the next step is automatically shown. See it as a sort of guided, automatized tour
  246. functionality. The value is specified in milliseconds</td>
  247. <td><code class="language-javascript">false</code></td>
  248. </tr>
  249. <tr>
  250. <td>basePath</td>
  251. <td>String</td>
  252. <td>Specify a default base path prepended to the
  253. <code class="language-javascript">path</code> option of every single
  254. step. Very useful if you need to reuse the same tour on different
  255. environments or sub-projects.</td>
  256. <td><code class="language-javascript">''</code></td>
  257. </tr>
  258. <tr>
  259. <td>template</td>
  260. <td>String|Function</td>
  261. <td>String or function that returns a string of the HTML template for
  262. the popovers. If you pass a Function, two parameters are available:
  263. <strong>i</strong> is the position of step in the tour and
  264. <strong>step</strong> is the an object that contains all the other step
  265. options.<br>
  266. From version 0.5, the navigation template is included inside the
  267. template so you can easily rewrite it. However, Bootstrap Tour maps the
  268. <em>previous</em>, <em>next</em> and <em>end</em> logics to the elements
  269. which have the related <code class="language-markup">data-role</code>
  270. attribute. Therefore, you can also have multiple elements with the same
  271. <code class="language-markup">data-role</code> attribute.
  272. </td>
  273. <td><pre class="language-javascript"><code>"&lt;div class='popover tour'&gt;
  274. &lt;div class='arrow'&gt;&lt;/div&gt;
  275. &lt;h3 class='popover-title'&gt;&lt;/h3&gt;
  276. &lt;div class='popover-content'&gt;&lt;/div&gt;
  277. &lt;div class='popover-navigation'&gt;
  278. &lt;button class='btn btn-default' data-role='prev'&gt;&laquo; Prev&lt;/button&gt;
  279. &lt;span data-role='separator'&gt;|&lt;/span&gt;
  280. &lt;button class='btn btn-default' data-role='next'&gt;Next &raquo;&lt;/button&gt;
  281. &lt;button class='btn btn-default' data-role='end'&gt;End tour&lt;/button&gt;
  282. &lt;/div&gt;
  283. &lt;/div&gt;"</code></pre>
  284. </td>
  285. </p>
  286. <tr>
  287. <tr>
  288. <td>afterGetState, afterSetState, afterRemoveState</td>
  289. <td>Function</td>
  290. <td>You may want to do something right after Bootstrap Tour read, write or remove
  291. the state. Just pass functions to these.<br />
  292. Your functions can have two parameters:
  293. <ul class="unstyled">
  294. <li>
  295. <strong>key</strong>
  296. Contains the name of the state being saved. It can be
  297. <code class="language-javascript">current_step</code> (for the state where the
  298. latest step the visitor viewed is saved) or
  299. <code class="language-javascript">end</code> (for the state which is saved when
  300. the user complete the tour). Note that Bootstrap Tour prepends the key with
  301. <code class="language-javascript">tour_</code> when saving the state.
  302. </li>
  303. <li>
  304. <strong>value</strong>
  305. The value of the state been saved. Can be the index of the
  306. current step if the key is <code class="language-javascript">current_step</code>, or
  307. <code class="language-javascript">yes</code> if the key is <code class="language-javascript">end</code>.
  308. </li>
  309. </ul>
  310. <p>A simple example if to send a post request to your server each
  311. time there is a change:</p>
  312. <pre class="language-javascript"><code>var tour = new Tour({
  313. afterSetState: function(key, value) {
  314. $.post("/some/path", value);
  315. }
  316. });</code></pre>
  317. </td>
  318. <td><code class="language-javascript">function(key, value) { }</code></td>
  319. </tr>
  320. <tr>
  321. <td>onStart</td>
  322. <td>Function</td>
  323. <td>Function to execute when the tour starts.</td>
  324. <td><code class="language-javascript">function(tour) { }</code></td>
  325. </tr>
  326. <tr>
  327. <td>onEnd</td>
  328. <td>Function</td>
  329. <td>Function to execute when the tour ends.</td>
  330. <td><code class="language-javascript">function(tour) { }</code></td>
  331. </tr>
  332. <tr>
  333. <td>onShow</td>
  334. <td>Function</td>
  335. <td>Function to execute right before each step is shown.</td>
  336. <td><code class="language-javascript">function(tour) { }</code></td>
  337. </tr>
  338. <tr>
  339. <td>onShown</td>
  340. <td>Function</td>
  341. <td>Function to execute right after each step is shown.</td>
  342. <td><code class="language-javascript">function(tour) { }</code></td>
  343. </tr>
  344. <tr>
  345. <td>onHide</td>
  346. <td>Function</td>
  347. <td>Function to execute right before each step is hidden.</td>
  348. <td><code class="language-javascript">function(tour) { }</code></td>
  349. </tr>
  350. <tr>
  351. <td>onHidden</td>
  352. <td>Function</td>
  353. <td>Function to execute right after each step is hidden.</td>
  354. <td><code class="language-javascript">function(tour) { }</code></td>
  355. </tr>
  356. <tr>
  357. <td>onNext</td>
  358. <td>Function</td>
  359. <td>Function to execute when next step is called.</td>
  360. <td><code class="language-javascript">function(tour) { }</code></td>
  361. </tr>
  362. <tr>
  363. <td>onPrev</td>
  364. <td>Function</td>
  365. <td>Function to execute when prev step is called.</td>
  366. <td><code class="language-javascript">function(tour) { }</code></td>
  367. </tr>
  368. <tr class="success">
  369. <td>onPause <span class="label label-success">NEW</span></td>
  370. <td>Function</td>
  371. <td>Function to execute when pause is called. The second argument refers to the
  372. remaining duration.</td>
  373. <td><code class="language-javascript">function(tour, duration) { }</code></td>
  374. </tr>
  375. <tr class="success">
  376. <td>onResume <span class="label label-success">NEW</span></td>
  377. <td>Function</td>
  378. <td>Function to execute when resume is called. The second argument refers to the
  379. remaining duration.</td>
  380. <td><code class="language-javascript">function(tour, duration) { }</code></td>
  381. </tr>
  382. </tbody>
  383. </table>
  384. <a id="step-options"></a>
  385. <h3>Step Options</h3>
  386. <pre class="language-javascript"><code>tour.addStep({
  387. path: "",
  388. element: "",
  389. placement: "right",
  390. title: "",
  391. content: "",
  392. next: 0,
  393. prev: 0,
  394. animation: true,
  395. container: "body",
  396. backdrop: false,
  397. redirect: true,
  398. reflex: false,
  399. orphan: false,
  400. template: "",
  401. onShow: function(tour) {},
  402. onShown: function(tour) {},
  403. onHide: function(tour) {},
  404. onHidden: function(tour) {},
  405. onNext: function(tour) {},
  406. onPrev: function(tour) {},
  407. onPause: function(tour) {},
  408. onResume: function(tour) {}
  409. });</code></pre>
  410. <table class="table table-bordered table-striped">
  411. <thead>
  412. <tr>
  413. <th>Name</th>
  414. <th>Type</th>
  415. <th>Description</th>
  416. <th>Default</th>
  417. </tr>
  418. </thead>
  419. <tbody>
  420. <tr>
  421. <td>path</td>
  422. <td>String</td>
  423. <td>Path to the page on which the step should be shown. This
  424. allows you to build tours that span several pages!</td>
  425. <td><code class="language-javascript">''</code></td>
  426. </tr>
  427. <tr>
  428. <td>element</td>
  429. <td>String (jQuery selector)</td>
  430. <td>HTML element on which the step popover should be shown.<br />
  431. <em>If orphan is false, this option is required.</em></td>
  432. <td><code class="language-javascript">''</code></td>
  433. </tr>
  434. <tr>
  435. <td>placement</td>
  436. <td>String|Function</td>
  437. <td>How to position the popover. Possible choices:
  438. <code class="language-javascript">'top'</code>,
  439. <code class="language-javascript">'bottom'</code>,
  440. <code class="language-javascript">'left'</code>,
  441. <code class="language-javascript">'right'</code>.
  442. </td>
  443. <td><code class="language-javascript">'right'</code></td>
  444. </tr>
  445. <tr>
  446. <td>title</td>
  447. <td>String|Function</td>
  448. <td>Step title</td>
  449. <td><code class="language-javascript">''</code></td>
  450. </tr>
  451. <tr>
  452. <td>content</td>
  453. <td>String|Function</td>
  454. <td>Step content</td>
  455. <td><code class="language-javascript">''</code></td>
  456. </tr>
  457. <tr>
  458. <td>next</td>
  459. <td>Integer</td>
  460. <td>Index of the step to show after this one, starting from
  461. <code class="language-javascript">0</code> for the first step of the
  462. tour. <code class="language-javascript">-1</code> to not show the link
  463. to next step. By default, the next step (in the order you added
  464. them) will be shown.<br />
  465. <em>This option should be used in conjunction with
  466. <code class="language-javascript">prev</code>.</em></td>
  467. <td><code class="language-javascript">0</code></td>
  468. </tr>
  469. <tr>
  470. <td>prev</td>
  471. <td>Integer</td>
  472. <td>Index of the step to show before this one, starting from
  473. <code class="language-javascript">0</code> for the first step of the
  474. tour. <code class="language-javascript">-1</code> to not show the link
  475. to previous step. By default, the previous step (in the order you added
  476. them) will be shown.<br />
  477. <em>This option should be used in conjunction with
  478. <code class="language-javascript">next</code>.</em></td>
  479. <td><code class="language-javascript">0</code></td>
  480. </tr>
  481. <tr>
  482. <td>animation</td>
  483. <td>Boolean</td>
  484. <td>Apply a css fade transition to the tooltip.</td>
  485. <td><code class="language-javascript">true</code></td>
  486. </tr>
  487. <tr>
  488. <td>container</td>
  489. <td>String (jQuery selector)</td>
  490. <td>Attachment of popover. Pass an element to append the popover
  491. to. By default the popover is appended after the 'element' above.
  492. This option is particularly helpful for Internet Explorer.</td>
  493. <td><code class="language-javascript">'body'</code></td>
  494. </tr>
  495. <tr>
  496. <td>backdrop</td>
  497. <td>Boolean</td>
  498. <td>Show a dark backdrop behind the popover and its element,
  499. highlighting the current step.</td>
  500. <td><code class="language-javascript">false</code></td>
  501. </tr>
  502. <tr>
  503. <td>redirect</td>
  504. <td>Boolean|Function</td>
  505. <td>Set a custom function to execute as redirect function.
  506. The default redirect relies on the traditional
  507. <code class="language-javascrip">document.location.href</code></td>
  508. <td><code class="language-javascript">true</code></td>
  509. </tr>
  510. <tr>
  511. <td>reflex</td>
  512. <td>Boolean</td>
  513. <td>Enable the reflex mode: you can click on the element for
  514. continue the tour.</td>
  515. <td><code class="language-javascript">false</code></td>
  516. </tr>
  517. <tr>
  518. <td>orphan</td>
  519. <td>Boolean</td>
  520. <td>Allow to show the step regardless whether its element is not set, is
  521. not present in the page or is hidden. The step is fixed
  522. positioned in the middle of the page.</td>
  523. <td><code class="language-javascript">false</code></td>
  524. </tr>
  525. <tr class="success">
  526. <td>duration <span class="label label-success">NEW</span></td>
  527. <td>Boolean|String</td>
  528. <td>Set a expiration time for the stes. When the step expires,
  529. the next step is automatically shown. See it as a sort of guided, automatized tour
  530. functionality. The value is specified in milliseconds</td>
  531. <td><code class="language-javascript">false</code></td>
  532. </tr>
  533. <tr>
  534. <td>template</td>
  535. <td>String|Function</td>
  536. <td>String or function that returns a string of the HTML template for
  537. the popovers. If you pass a Function, two parameters are available:
  538. <strong>i</strong> is the position of step in the tour and
  539. <strong>step</strong> is the an object that contains all the other step
  540. options.<br>
  541. From version 0.5, the navigation template is included inside the
  542. template so you can easily rewrite it. However, Bootstrap Tour maps the
  543. <em>previous</em>, <em>next</em> and <em>end</em> logics to the elements
  544. which have the related <code class="language-markup">data-role</code>
  545. attribute. Therefore, you can also have multiple elements with the same
  546. <code class="language-markup">data-role</code> attribute.
  547. </td>
  548. <td><pre class="language-javascript"><code>"&lt;div class='popover tour'&gt;
  549. &lt;div class='arrow'&gt;&lt;/div&gt;
  550. &lt;h3 class='popover-title'&gt;&lt;/h3&gt;
  551. &lt;div class='popover-content'&gt;&lt;/div&gt;
  552. &lt;div class='popover-navigation'&gt;
  553. &lt;button class='btn btn-default' data-role='prev'&gt;&laquo; Prev&lt;/button&gt;
  554. &lt;span data-role='separator'&gt;|&lt;/span&gt;
  555. &lt;button class='btn btn-default' data-role='next'&gt;Next &raquo;&lt;/button&gt;
  556. &lt;button class='btn btn-default' data-role='end'&gt;End tour&lt;/button&gt;
  557. &lt;/div&gt;
  558. &lt;/div&gt;"</code></pre>
  559. </td>
  560. </tr>
  561. <tr>
  562. <td>onShow</td>
  563. <td>Function</td>
  564. <td>Function to execute right before the step is shown. It overrides the
  565. global <code class="language-javascript">onShow</code> option.</td>
  566. <td><code class="language-javascript">function(tour) { }</code></td>
  567. </tr>
  568. <tr>
  569. <td>onShown</td>
  570. <td>Function</td>
  571. <td>Function to execute right after the step is shown. It overrides the
  572. global <code class="language-javascript">onShown</code> option.</td>
  573. <td><code class="language-javascript">function(tour) { }</code></td>
  574. </tr>
  575. <tr>
  576. <td>onHide</td>
  577. <td>Function</td>
  578. <td>Function to execute right before the step is hidden. It overrides
  579. the global <code class="language-javascript">onHide</code> option.</td>
  580. <td><code class="language-javascript">function(tour) { }</code></td>
  581. </tr>
  582. <tr>
  583. <td>onHidden</td>
  584. <td>Function</td>
  585. <td>Function to execute right after the step is hidden. It overrides the
  586. global <code class="language-javascript">onHidden</code> option.</td>
  587. <td><code class="language-javascript">function(tour) { }</code></td>
  588. </tr>
  589. <tr>
  590. <td>onNext</td>
  591. <td>Function</td>
  592. <td>Function to execute when next step is called. It overrides the
  593. global <code class="language-javascript">onNext</code> option.</td>
  594. <td><code class="language-javascript">function(tour) { }</code></td>
  595. </tr>
  596. <tr>
  597. <td>onPrev</td>
  598. <td>Function</td>
  599. <td>Function to execute when prev step is called. It overrides the global
  600. <code class="language-javascript">onPrev</code> option.</td>
  601. <td><code class="language-javascript">function(tour) { }</code></td>
  602. </tr>
  603. <tr class="success">
  604. <td>onPause <span class="label label-success">NEW</span></td>
  605. <td>Function</td>
  606. <td>Function to execute when pause is called. The second argument refers to the
  607. remaining duration. It overrides the global the
  608. <code class="language-javascript">onPause</code> option</td>
  609. <td><code class="language-javascript">function(tour, duration) { }</code></td>
  610. </tr>
  611. <tr class="success">
  612. <td>onResume <span class="label label-success">NEW</span></td>
  613. <td>Function</td>
  614. <td>Function to execute when resume is called. The second argument refers to the
  615. remaining duration. It overrides the global
  616. <code class="language-javascript">onResume</code> option</td>
  617. <td><code class="language-javascript">function(tour, duration) { }</code></td>
  618. </tr>
  619. </tbody>
  620. </table>
  621. </div>
  622. </section>
  623. <section id="methods">
  624. <div class="container">
  625. <div class="page-header">
  626. <h2>Methods <small>Always in control</small></h2>
  627. </div>
  628. <!--<p>If, for some reasons, you want to force the tour to be
  629. displayed, pass <code class="language-javascript">true</code> to the <code class="language-javascript">start()</code>
  630. method.</p>-->
  631. <table class="table table-bordered table-striped">
  632. <thead>
  633. <tr>
  634. <th>Name</th>
  635. <th>Description</th>
  636. </tr>
  637. </thead>
  638. <tbody>
  639. <tr>
  640. <td>init()</td>
  641. <td>Initialize the tour. You must do it before calling start.</td>
  642. </tr>
  643. <tr>
  644. <td>start(<code class="language-javascript">true</code>)</td>
  645. <td>Start the tour. Pass <code class="language-javascript">true</code> to force the start.</td>
  646. </tr>
  647. <tr>
  648. <td>restart()</td>
  649. <td>Restart the tour after it ended.</td>
  650. </tr>
  651. <tr>
  652. <td>end()</td>
  653. <td>End the tour prematurely.</td>
  654. </tr>
  655. <tr>
  656. <td>next()</td>
  657. <td>Skip to the next step.</td>
  658. </tr>
  659. <tr>
  660. <td>prev()</td>
  661. <td>Go back to the previous step.</td>
  662. </tr>
  663. <tr class="warning">
  664. <td>goTo(<code class="language-javascript">i</code>)
  665. <span class="label label-warning">UPDATED</span></td>
  666. <td>Skip to a specific step. Pass <code class="language-javascript">i</code> as the
  667. position of the step in the tour, starting from 0 for the first step.<br>
  668. <em>From version 0.7.0, the method has been renamed since some Javascript compilers
  669. are confused by the property name <strong>goto</strong>, which is a reserved word)
  670. </em>
  671. </td>
  672. </tr>
  673. <tr>
  674. <td>pause()</td>
  675. <td>Pause the duration timer. It works only if tour or current stap has duration.</td>
  676. </tr>
  677. <tr>
  678. <td>resume()</td>
  679. <td>Resume the duration timer. It works only if tour or current stap has duration.</td>
  680. </tr>
  681. <tr>
  682. <td>ended()</td>
  683. <td>Verify if the tour ended. Returns boolean.</td>
  684. </tr>
  685. </tbody>
  686. </table>
  687. </div>
  688. </section>
  689. <section id="contributing">
  690. <div class="container">
  691. <div class="page-header">
  692. <h2>Contributing <small>Do you think we need help? You are totally right</small></h2>
  693. </div>
  694. <p>Without your <a href="https://github.com/sorich87/bootstrap-tour/issues">bug
  695. reports</a> and <a href="https://github.com/sorich87/bootstrap-tour/pulls">pull
  696. requests</a>, we are nothing. Make this plugin better!</p>
  697. <h3>Grunt Usage</h3>
  698. <div id="grunt-usage" class="accordion">
  699. <div class="panel panel-default">
  700. <div class="panel-heading">
  701. <h4 class="panel-title">
  702. <a class="accordion-toggle" data-toggle="collapse" data-parent="#grunt-usage" href="#install-dependencies">Install Dependencies</a>
  703. </h4>
  704. </div>
  705. <div id="install-dependencies" class="panel-collapse collapse in">
  706. <div class="panel-body">
  707. <p>Files to be developed inside the project are located under
  708. <code>/src/</code>.</p>
  709. <p>Compiled sources are then automatically put under
  710. <code>/build/</code> (and <code>/test/</code>).</p>
  711. </div>
  712. </div>
  713. </div>
  714. <div class="panel panel-default">
  715. <div class="panel-heading">
  716. <h4 class="panel-title">
  717. <a class="accordion-toggle" data-toggle="collapse" data-parent="#grunt-usage" href="#run-tasks">Run main tasks (check <code>Gruntfile.coffee</code> for more infos)</a>
  718. </h4>
  719. </div>
  720. <div id="run-tasks" class="accordion-body collapse">
  721. <div class="panel-body">
  722. <pre class="language-javascript"><code>// Start a server and run the demo page
  723. grunt
  724. grunt run
  725. // Compile all sources
  726. grunt build
  727. // Compile all sources and run the tests
  728. grunt test
  729. // Automatically release a new version (see below for more details)
  730. grunt release</code></pre>
  731. </div>
  732. </div>
  733. </div>
  734. <div class="panel panel-default">
  735. <div class="panel-heading">
  736. <h4 class="panel-title">
  737. <a class="accordion-toggle" data-toggle="collapse" data-parent="#grunt-usage" href="#releasing">Automatically releasing</a>
  738. </h4>
  739. </div>
  740. <div id="releasing" class="accordion-body collapse">
  741. <div class="panel-body">
  742. <p>Releasing a new version is completely automated using the Grunt task <code class="language-bash">grunt release</code>.</p>
  743. <pre class="language-javascript"><code>grunt release // patch release
  744. grunt release:minor // minor release
  745. grunt release:major // major release</code></pre>
  746. </div>
  747. </div>
  748. </div>
  749. <div class="panel panel-default">
  750. <div class="panel-heading">
  751. <h4 class="panel-title">
  752. <a class="accordion-toggle" data-toggle="collapse" data-parent="#grunt-usage" href="#live-reload">Live reload</a>
  753. </h4>
  754. </div>
  755. <div id="live-reload" class="accordion-body collapse">
  756. <div class="panel-body">
  757. <p>Running <code class="language-bash">grunt run</code> will start a small server on port <code class="language-bash">3000</code> and opens the browser to the webpage. It will also start watching for changes in the <code class="language-bash">index.coffee</code> which will trigger then live reloading of the page in the browser.</p>
  758. </div>
  759. </div>
  760. </div>
  761. <div class="panel panel-default">
  762. <div class="panel-heading">
  763. <h4 class="panel-title">
  764. <a class="accordion-toggle" data-toggle="collapse" data-parent="#grunt-usage" href="#test">Run the tests</a>
  765. </h4>
  766. </div>
  767. <div id="test" class="accordion-body collapse">
  768. <div class="panel-body">
  769. <p>Tests are written using <a href="http://pivotal.github.io/jasmine/" target="_blank">Jasmine</a> and they run headlessly through <a href="http://phantomjs.org/" target="_blank">PhantomJS</a>.<br>
  770. Simply run <code class="language-bash">grunt test</code> or watch them with <code class="language-bash">grunt watch:test</code> (this will execute them automatically every time you change the specs).</p>
  771. <p>You can also open the <code>_SpecRunner.html</code> (generated after you run <code class="language-bash">grunt test</code>) to run the tests in the browser.</p>
  772. </div>
  773. </div>
  774. </div>
  775. </div>
  776. <h3>Team</h3>
  777. <div class="row">
  778. <div class="col-sm-4">
  779. <img src="" class="gravatar img-circle" data-email="sorich87@gmail.com"> Ulrich Sossou
  780. </div>
  781. <div class="col-sm-4">
  782. <img src="" class="gravatar img-circle" data-email="emanuele@lostcrew.it"> Emanuele Marchi
  783. </div>
  784. <div class="col-sm-4">
  785. <img src="" class="gravatar img-circle" data-email="emmenko@gmail.com"> Luca Molinari
  786. </div>
  787. </div>
  788. </section>
  789. <section id="license">
  790. <div class="container">
  791. <div class="page-header">
  792. <h2>License</h2>
  793. </div>
  794. <p>Code licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>.<br>
  795. Documentation licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.<br>
  796. Well, the same licenses as Bootstrap. We are lazy! ;)</p>
  797. </div>
  798. </section>
  799. <script src="assets/vendor/jquery.js"></script>
  800. <script src="assets/vendor/bootstrap.js"></script>
  801. <script src="assets/vendor/prism.js"></script>
  802. <script src="assets/vendor/jquery.smoothscroll.js"></script>
  803. <script src="assets/vendor/md5.js"></script>
  804. <script src="assets/js/bootstrap-tour.js"></script>
  805. <script src="assets/js/index.js"></script>
  806. </body>
  807. </html>