问题描述
是否有人知道如何向intro.js添加可在转到目标元素时打开菜单的步骤.我在网站的左上角有一个按钮.当用户单击该按钮时,将显示一个菜单.在介绍intro.js时,无法在intro.js中找到打开该菜单的方法.
Does anyone know how to add an step to intro.js that can open a menu when going to the target element. I have button on the left corner of my website. When user click that button a menu will be displayed. I could not find a way in intro.js to open that menu when intro is on that step.
推荐答案
模拟对特定步骤的点击:
在调查了如何在特定步骤中 模仿了一个点击后,请参见: https://github.com/usablica/intro.js/pull/380/files?short_path=04c6e90
Emulate a click on a specific step:
After investigating how to emulate a click when IntroJS is in a specific step see: https://github.com/usablica/intro.js/pull/380/files?short_path=04c6e90
此功能提交中的建议是使用:
属性data-click
:在工具提示上方显示点击动画.
The proposal in this feature commit is to use the:
Attribute data-click
: Show a click animation over the tooltip.
我建议您模拟点击或您想动态执行的任何操作:在每个步骤触发功能,这样您就可以做更复杂的事情.
I'll recommend that you emulate a click or whatever you want to do dynamically: firing a function at each step, this allows you to do more complex things.
为此,我们使用onchange: function(){...}
.
您可以设置函数回调或对操作进行硬编码,以模拟对function(){}
块内元素的单击.
We use onchange: function(){...}
for this.
You can set a function callback or hard-code the actions to emulate a click on the element inside the function(){}
block.
工作示例: http://www.observatoriodeviolencias.net/
这篇关于逐步介绍intro.js中的单击功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!