需要双击的自定义属性(羽毛灯灯箱) [英] Custom attribute requiring double click (featherlight lightbox)

查看:90
本文介绍了需要双击的自定义属性(羽毛灯灯箱)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,这是 jsfiddle :

这是插件的链接( featherlight灯箱)

问题在于,使用默认的targetAttr(data-featherlight)时,只需单击一下即可使用.

The issue is that using the default targetAttr (which is data-featherlight), it works with only one click.

但是,使用自定义的targetAttr(例如本示例中的data-single),我必须在灯箱打开之前单击两次.

However, with a custom targetAttr (such as data-single in this example), I have to click twice before the lightbox opens.

有人可以帮我为什么会这么做吗?

Could someone help me out why it is doing it?

谢谢.

推荐答案

featherlight()具有内置的点击触发器,因此您只需要直接调用插件即可:

featherlight() has a build-in click trigger so you just need to call the plugin directly:

jQuery('.something_else').featherlight({
       targetAttr: 'data-single',                  
}); 

请参阅: https://jsfiddle.net/5e9e2k6y/9/

这篇关于需要双击的自定义属性(羽毛灯灯箱)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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