var tutorial = [{
"header": "<i class='fa fa-map-marker' style='margin-right:11px;'></i>Restaurant Selector",
"content": "Select the restaurants to work on using this tool.",
"position": "screen-center",
"expose": true
}, {
"sel": ".context_restaurant_2",
"header": "Search",
"content": "In this field, type information about the restaurant, such as its unique ID or the street it is on.",
"position": "s",
"expose": true
}, {
"sel": ".context_restaurant_3",
"header": "Search Again!",
"content": "You can also search for groups of restaurants. For example, you could type the name of a region and select it. This would select all your stores that belong to that region.",
"position": "s",
"expose": true
}, {
"sel": ".context_restaurant_4",
"header": "Start Over",
"content": "Click here to remove all selected restaurants and start over with a clean slate.",
"position": "n",
"expose": true
}];
var options = {
delay: -1,
showNavigation: true,
showHeader: true
};
$("#btnToggler").click(function() {
$('#div2').toggle();
});
$("#btnClassRemover").click(function() {
$('#div2').toggleClass('context_restaurant_3');
});
$("#btnStart").click(function() {
var adaptedTutorial = prepareTutorial();
var trip = new Trip(adaptedTutorial, options);
trip.start();
});
function prepareTutorial() {
var adaptedTutorial = [];
tutorial.forEach(function(e) {
if (!e.sel) {
adaptedTutorial.push(e);
} else {
var element = $(e.sel);
if (element.length && element.is(':visible')) {
adaptedTutorial.push(e);
}
}
});
return adaptedTutorial;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.