javascript - How to disable prettyPhoto? - Stack Overflow

I now how to enable prettyphoto, but the problem is how to disable?Here i enable prettyPhoto$(document)

I now how to enable prettyphoto, but the problem is how to disable?

Here i enable prettyPhoto

$(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({ social_tools:false, }); }); 

How to disable?

I now how to enable prettyphoto, but the problem is how to disable?

Here i enable prettyPhoto

$(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({ social_tools:false, }); }); 

How to disable?

Share Improve this question asked Oct 11, 2013 at 6:53 Miomir DancevicMiomir Dancevic 6,85216 gold badges85 silver badges154 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4
    $("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');

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745646101a4637980.html

相关推荐

  • javascript - How to disable prettyPhoto? - Stack Overflow

    I now how to enable prettyphoto, but the problem is how to disable?Here i enable prettyPhoto$(document)

    22天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信