admin管理员组文章数量:1026373
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 badges2 Answers
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');
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 badges2 Answers
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');
本文标签: javascriptHow to disable prettyPhotoStack Overflow
版权声明:本文标题:javascript - How to disable prettyPhoto? - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745646100a2161034.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论