我正在使用Joyride 插件进行导游。我需要获取在函数ol
中启动兜风的旅游 ID(标签 ID) 。postRideCallback
这个函数只有index
andcurrent_tip
作为参数,我不知道如何获取 ID handlePostRideCall
,我研究了这个库,没有任何效果。
HTML:
/* Each tip is set within this <ol>. */
/* This creates the order the tips are displayed */
<ol id="joyRideTipContent">
/* data-id needs to be the same as the parent it will attach to */
<li data-id="newHeader">Tip content...</li>
/* This tip will be display as a modal */
<li>Tip content...</li>
/* using 'data-button' lets you have custom button text */
<li data-class="parent-element-class" data-options="tipLocation:top;tipAnimation:fade" data-button="Second Button">Content...</li>
/* you can put a class for custom styling */
<li data-id="parentElementID" class="custom-class">Content...</li>
</ol>
JS:
<script>
$(window).load(function() {
$('#joyRideTipContent').joyride({
autoStart : true,
postStepCallback : handlePostRideCall,
modal:true,
expose: true
});
});
function handlePostRideCall(index, tip){
// get ol ID here
}
</script>