简体   繁体   English

点击qtip2仅显示一次

[英]qtip2 on click is only showing once

I'm trying to configure qTip2 to show up when i click a div. 我正在尝试配置qTip2以在单击div时显示。

It works only at the first click... 仅在第一次点击时有效...

I have a sample here: http://jsfiddle.net/8qLXF/1/ 我在这里有一个示例: http : //jsfiddle.net/8qLXF/1/

The crazy thing is: I'm using the same configuration in other part of my project and it works fine. 疯狂的事情是:我在项目的其他部分使用了相同的配置,并且运行良好。

You are applying the plugin to the element every time that element( a ) is clicked. 每次单击元素( a )时,您都将插件应用于元素。 You should do $('...').qtip({..}) to an element only once. 您应该只对元素执行一次$('...').qtip({..})

You can use .one() to bind a click event that will happen only once. 您可以使用.one()绑定仅发生一次的click事件。 Sample 样品

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM