$tour = new Tour([
'scope' => 'window', //Set scope to make the 'tour' variable global
'startMode' => Tour::START_MODE_FORCE_START, //initialize and force start the tour
'clientOptions' => [ //Bootstrap Tour Options, see: http://bootstraptour.com/api/
'steps' => [
[
'element' => "#h1",
'title' => "Step 1",
'content' => "Content of my step 1",
'backdrop' => "true",
],
[
'element' => "#h2",
'title' => "Step 2",
'content' => "Content of my step 2",
],
],
'storage' => "false"
],
]);
$tour->run();
echo Html::button('Start the tour', ['onclick' => $tour->getVarName().'.start(true);' //use $tour->getVarName() to get the reference to the 'tour' var name
]);
I am trying to run the tour manually. I have written the code in view file. When I run the code in console
I am getting Error - VM1152 :459 Uncaught TypeError: Cannot read property 'start' of undefined
at HTMLButtonElement.onclick (VM1152 :459).
I have checked the bootstrap tour css and JS files are getting loaded in browser. But in console I am getting this error. Can you please help?