轩枫阁

首页 / 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,问题解决~

相关文章

纸飞机许愿

x

钢琴节奏

请选择弹奏的曲谱

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

    [返回曲谱列表]