![](/img/trans.png)
[英]How to add a 'Done' button at the final step of multipage intro.js tour?
[英]How to allow users to replay an intro.js tour upon clicking a button?
一種方法是制作一個可點擊的按鈕,調用 function 來播放游覽:
<input type="button" id="startTour" value="Restart Tour" onclick="restartTour();">
並在 JS 腳本中添加游覽 Json:
function restartTour() { introJs().setOptions({ steps: [{ ##create tour STEPS here }] }).start(); };
另一種方法是這樣的按鈕:
<input type="button" id="restartTour" value="Restart Tour">
和這樣的JS:
function startTour() { introJs().setOptions({ steps: [{ title: 'Welcome ', intro: "some info", }, { element: document.getElementById('files'), title: 'a title', intro: 'some info', position: 'top', }, ] }).start(); }; // Wrap this Jinja conditional for first time window.onload = function() { startTour(); }; // document.getElementById("restartTour").addEventListener("click", startTour) document.getElementById("restartTour").onclick = startTour;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.