逐步介绍intro.js中的单击功能 [英] Step with click functionality in intro.js

查看:426
本文介绍了逐步介绍intro.js中的单击功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人知道如何向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.

推荐答案

应该强调的是,该功能不是正式的 支持.

It should be emphasized that the functionality is not officially supported.

模拟对特定步骤的点击:

在调查了如何在特定步骤中 模仿了一个点击后,请参见:

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.

变更步骤事件: https://stackoverflow.com/a/42324402/3172310
更改步骤时回调: https://stackoverflow.com/a/17157644/3172310

Alter step events: https://stackoverflow.com/a/42324402/3172310
Callback on step changes: https://stackoverflow.com/a/17157644/3172310

工作示例: http://www.observatoriodeviolencias.net/

这篇关于逐步介绍intro.js中的单击功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆