通过检测类禁用prettyPhoto特定链接

时间:2013-06-17 11:58:38

标签: javascript jquery jquery-plugins overlay prettyphoto

查看如何在单击的链接具有特定类的情况下完全禁用prettyPhoto poup overlay的解决方案。到目前为止,无论它一直忽略我的if条件。

以下是代码:

    (function(){
            var targetLink = $('.popup');                              

            targetLink.click(function(){

            if($(this).hasClass('mobile')){

            //do my stuff and then          

            } else {

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

            }

return false;

            });

        })(); 

任何想法都会被贬低。

告诉你。

1 个答案:

答案 0 :(得分:0)

这应该会阻止prettyPhoto应用于元素具有移动类的链接。

$("a[rel^='prettyPhoto']:not(.mobile)").prettyPhoto({
    deeplinking:false,
    social_tools:false      
});
相关问题