Trip.js is a useful plugin that can help you customize a tutorial trip easily. ( Based on jQuery )
-
include jQuery
-
include Trip.css
-
include Trip.js
-
setup trip codes shown below
var trip = new Trip([ { sel : $('#element1'), content : 'This is element 1' }, { sel : $('#element2'), content : 'This is element 2' } ], options); // details about options are listed below
You can set tripIndex ( start from 0 ) to specific trip block at start.
- Type: number
- Default:
0
You can set a callback function triggered when the trip starts
- Type: function
- Default:
$.noop
You can set a callback function triggered when the trip ends
- Type: function
- Default:
$.noop
You can ask Trip.js go back to top when ended
- Type: boolean
- Default:
false
You can set the basic zIndex for overlay if you want to expose elements
- Type: number
- Default:
99999
every trip will be lived for 1 second (1000 ms) by default
- Type: number
- Default:
1000
Trip.js would detect following keys to do relative actions after loading it.
- Right and Down arrows - Go to next trip
- Left and Up arrows - Go back to previous trip
- Space - pause / resume trip
- Esc - Stop trip
- trip.start() - start your trip
- trip.stop() - stop your trip
- trip.pause() - pause / resume your trip
- Add different Trip themes
- Make new direction images with new themes
- Add Compress source code
EragonJ ( [email protected] )
MIT