How to disable prettyPhoto?

狂风中的少年 提交于 2019-12-04 07:41:30
    $("a[rel^='prettyPhoto']").unbind('click');
    $("a[rel^='prettyPhoto']").attr('rel', '');

Just unbind click and rel attribute.

Sadly the prettyPhoto does not seem to have a "turnOff" option. If you are not using any other click event handlers for those links, @Yenne Info 's answer is just fine.

If you don't want to unbind all click event handlers:

Looking through the prettyPhoto code - at the end of method definition, you can find something like:

return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);

So the proper unbind without losing other click-related event handlers would be (generally for all links):

jQuery('a').unbind('click.prettyphoto');

For your specific selector:

$("a[rel^='prettyPhoto']").unbind('click.prettyphoto');
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!