2
我在我的網站上使用intro.js瀏覽。我使用bottom
作爲默認工具提示位置,但是有沒有辦法在旅程開始後更改工具提示的位置?Intro.js更改工具提示位置
這裏是我的代碼:
tourPluginObject=introJs();
tourPluginObject.onchange(function(targetElement) {
if($(targetElement).attr("data-step")==5 && enteredStepFive==false){
enteredStepFive=true;//I entered a step five, so mark this
tourPluginObject.setOption('tooltipPosition','left');//Set new tooltip position
tourPluginObject.setOption('data-position','left');//Set new tooltip position
tourPluginObject.refresh();//Refresh layout
}
});
tourPluginObject.setOptions({'tooltipPosition': 'bottom' });//Set default tooltip position
tourPluginObject.start();//Start tour
爲什麼不使用這裏的選項https://introjs.com/docs/intro/options/ – 2017-11-23 21:39:34