Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户单击fancybox 2 中的默认关闭按钮时,如何编写函数?每当我将鼠标悬停在关闭按钮上时,它都会javascript:;在 Chrome 中显示我。
javascript:;
这是图像
只需将tplAPI 选项添加到您的自定义脚本并href从关闭按钮模板中删除该属性,例如:
tpl
href
$(".fancybox").fancybox({ tpl: { closeBtn: '<a title="Close" class="fancybox-item fancybox-close"></a>' } });
见JSFIDDLE