轩枫阁

首页 / WP视点 / WP Lightbox 2插件在ajax中使用时出错

WP Lightbox 2插件在ajax中使用时出错

I ‘ve noticed that my images( the links around them) that i load with ajax calls arent have the click event triggered on them, so the lightbox is not working on theses new elements,

I think this comes from a wrong syntax of .on() function;

line 47:

this is the syntax for .live() function;

The jQuery documentation show that :

you should bind this way:
$(document).on(“click”, this, onClick);

It worked for me with my own events…

状况:使用ajax加载的图片,不能使用lightbox的效果,解决方法是把wp-lightbox-2.js第47行的代码的on改成live,问题解决~

本文标题:WP Lightbox 2插件在ajax中使用时出错 - 轩枫阁

转载请务必注明出处,欢迎分享

如果觉得我的文章对您有用,请随意打赏
赞  赏
赞赏作者 轩枫-ivan
¥ 6.66
换个金额 使用微信扫一扫赞赏
  • 6.66
  • 8.88
  • 16.8
  • 2.33
  • 52.0
  • 20.0
  • 自定义
  • 10.0
362/437
364/437

相关文章

文章评论

纸飞机许愿

x

钢琴节奏

请选择弹奏的曲谱

    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 1
    • 2

    [返回曲谱列表]