|
| 1 | +# JQuery My Tour Guide |
| 2 | + |
| 3 | +> Original Repos: |
| 4 | +> - JQuery My Tour Guide: https://github.com/a19836/jquerymytourguide/ |
| 5 | +> - Bloxtor: https://github.com/a19836/bloxtor/ |
| 6 | +
|
| 7 | +## Overview |
| 8 | + |
| 9 | +**JQuery My My Tour Guide** is a lightweight JavaScript library that extends the functionality of the [LikaloLLC Tourguide](https://github.com/LikaloLLC/tourguide.js?tab=readme-ov-file) library. |
| 10 | +It provides an easy way to create interactive guided tours for your web applications. |
| 11 | + |
| 12 | +Check out a live example by opening [index.html](index.html). |
| 13 | + |
| 14 | +Requirements: |
| 15 | +- jquery library |
| 16 | + |
| 17 | +Additional details about **LikaloLLC Tourguide** can be found [here](lib/tourguide/README.md). |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Examples |
| 22 | + |
| 23 | +- [Simple Tour Guide Example](./index.html) |
| 24 | +- [Tour Guide with steps defined in HTML attributes (`data-tour`)](./lib/tourguide/test/index_with_html_attribute.html) |
| 25 | +- [Tour Guide with steps defined in JavaScript](./lib/tourguide/test/index_with_js_steps.html) |
| 26 | +- [Tour Guide with steps defined on the server side (JSON)](./lib/tourguide/test/index_with_remote_steps.html) |
| 27 | +- [Example with images (JSFiddle)](https://jsfiddle.net/eugenetrue/q465gb7L/) |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Screenshots |
| 32 | + |
| 33 | +- [example 1](./img/example_1.png) |
| 34 | +- [example 2](./img/example_2.png) |
| 35 | +- [example 3](./img/example_3.png) |
| 36 | +- [example 4](./img/example_4.png) |
| 37 | +- [example 5](./img/example_5.png) |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Usage |
| 42 | + |
| 43 | +```html |
| 44 | +<html> |
| 45 | +<head> |
| 46 | + <!-- Add jquery lib --> |
| 47 | + <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> |
| 48 | + |
| 49 | + <!-- Add jquery tourguide lib --> |
| 50 | + <script language="javascript" type="text/javascript" src="lib/tourguide/tourguide.js"></script> |
| 51 | + |
| 52 | + <!-- Add jquerymytourguide lib --> |
| 53 | + <script language="javascript" type="text/javascript" src="js/MyTourGuide.js"></script> |
| 54 | +</head> |
| 55 | +<body> |
| 56 | + <h1>More examples <a href="lib/tourguide/index.html" target="eg">here</a></h1> |
| 57 | + <ul> |
| 58 | + <li> |
| 59 | + <button class="btn">Button TEST 1</button> |
| 60 | + <button class="btn">Button TEST 2</button> |
| 61 | + <button class="btn2" style="display:none">Button TEST 3</button> |
| 62 | + </li> |
| 63 | + <li> |
| 64 | + <div class="msg">Some msg</div> |
| 65 | + </li> |
| 66 | + </ul> |
| 67 | + <div> |
| 68 | + <button onClick="MyTourGuide.restart()">Restart tour again</button> |
| 69 | + </div> |
| 70 | + |
| 71 | + <script> |
| 72 | + var steps = [ |
| 73 | + { |
| 74 | + "selector":".btn, .btn2", |
| 75 | + "title":"Tooltip Tour Guide", |
| 76 | + "content":"Create a new project by clicking in the blue button", |
| 77 | + }, |
| 78 | + { |
| 79 | + "selector":".msg", |
| 80 | + "title":"Tooltip Tour Guide", |
| 81 | + "content":"then click the created project to select it..." |
| 82 | + } |
| 83 | + ]; |
| 84 | + |
| 85 | + var options = { |
| 86 | + steps: steps, |
| 87 | + onStart: func1, //callback called when tourguide starts: func1(options); |
| 88 | + onStep: func2, //callback called when changing to another tourguide step: func2(current_step, type); |
| 89 | + onStop: func3, //callback called when tourguide stops: func3(options); |
| 90 | + onComplete: func4, //callback called when tourguide completes: func4(); |
| 91 | + }; |
| 92 | + MyTourGuide.init(options); |
| 93 | + MyTourGuide.start(); //(optional) to start on page load |
| 94 | + </script> |
| 95 | +</body> |
| 96 | +</html> |
| 97 | +``` |
| 98 | + |
| 99 | +## Other calls |
| 100 | + |
| 101 | +Creates a second tourguide variable: |
| 102 | +``` |
| 103 | +var MyTourGuide2 = new MyTourGuideClass(); |
| 104 | +``` |
| 105 | + |
| 106 | +Gets the tourguide internal library from jquery: |
| 107 | +``` |
| 108 | +var tg = MyTourGuide.tourguide; |
| 109 | +``` |
| 110 | + |
| 111 | +Gets the current active options when the tourguide was initialized: |
| 112 | +``` |
| 113 | +var options = MyTourGuide.options |
| 114 | +``` |
| 115 | + |
| 116 | +Starts tourguide: |
| 117 | +``` |
| 118 | +MyTourGuide.start(step_index); //step_index is optional. |
| 119 | +``` |
| 120 | + |
| 121 | +Stops tourguide: |
| 122 | +``` |
| 123 | +MyTourGuide.stop(); |
| 124 | +``` |
| 125 | + |
| 126 | +Completes tourguide: |
| 127 | +``` |
| 128 | +MyTourGuide.complete(); |
| 129 | +``` |
| 130 | + |
| 131 | +Restarts tourguide: |
| 132 | +``` |
| 133 | +MyTourGuide.restart(); |
| 134 | +``` |
| 135 | + |
| 136 | +Checks if tourguide is active: |
| 137 | +``` |
| 138 | +MyTourGuide.isActive(); |
| 139 | +``` |
| 140 | + |
| 141 | +Executes onStart callback: |
| 142 | +``` |
| 143 | +MyTourGuide.onStart(options); |
| 144 | +``` |
| 145 | + |
| 146 | +Executes onStep callback: |
| 147 | +``` |
| 148 | +MyTourGuide.onStep(current_step, type); |
| 149 | +``` |
| 150 | + |
| 151 | +Executes onStop callback: |
| 152 | +``` |
| 153 | +MyTourGuide.onStop(options); |
| 154 | +``` |
| 155 | + |
| 156 | +Executes onComplete callback: |
| 157 | +``` |
| 158 | +MyTourGuide.onComplete(); |
| 159 | +``` |
| 160 | + |
| 161 | +Executes the steps callback: |
| 162 | +``` |
| 163 | +MyTourGuide.prepareSteps(steps); |
| 164 | +``` |
| 165 | + |
| 166 | +Prepares tourguide with handlers and options. This is already called in the init method: |
| 167 | +``` |
| 168 | +MyTourGuide.prepareTourguide(); |
| 169 | +``` |
| 170 | + |
| 171 | +Prepare a step: |
| 172 | +``` |
| 173 | +MyTourGuide.prepareStep(current_step, type); |
| 174 | +``` |
| 175 | + |
| 176 | +Prepare a step arrow: |
| 177 | +``` |
| 178 | +MyTourGuide.prepareStepArrow(current_step); |
| 179 | +``` |
| 180 | + |
| 181 | +Get the step arrow position: |
| 182 | +``` |
| 183 | +var position = MyTourGuide.getStepArrowPosition(current_step); |
| 184 | +``` |
| 185 | + |
| 186 | +Get the tourguide style: |
| 187 | +``` |
| 188 | +var style = MyTourGuide.getStyle(); |
| 189 | +
|
| 190 | +``` |
| 191 | + |
0 commit comments