4

私はprettyphotoのバージョン3.1.4を使用しています。(http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/)。URLから「#prettyphoto [iframe] /number/」を削除したい。私はdeeplinking:falseを設定しましたが、これは役に立ちません。私はそれがこれらの機能からの問題であるかもしれないことを理解しました:

function getHashtag(){url=location.href;hashtag=(url.indexOf('#prettyPhoto')!==-1)?decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false;return hashtag;};
function setHashtag(){if(typeof theRel=='undefined')return;location.hash=theRel+'/'+rel_index+'/';};
function clearHashtag(){if(location.href.indexOf('#prettyPhoto')!==-1)location.hash="prettyPhoto";}

何か案が?

4

4 に答える 4

10

これは私のコードであり、それは私のために働いた:

    <script type="text/javascript" charset="utf-8">
      $(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto({
        social_tools:false,
        deeplinking:false});
      });
    </script>
于 2013-08-15T16:06:03.607 に答える
1

a)これは私のために働いた:

function clearHashtag(){
    if(location.href.indexOf('#prettyPhoto')!==-1)
        location.hash="";
}

このコードはjquery.prettyPhoto.jsの下部にあります

b)設定のような別の方法があります:ディープリンク: jquery.prettyPhoto.jsの先頭でfalse。

私はここで意味します:

(function($){$.prettyPhoto={version:'3.1.4'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({.. deeplinking: false; ...}

私が助けてくれたことを願っています。

于 2013-03-26T08:11:35.760 に答える
1

3.1.5バージョンは動作します

(function($){$.prettyPhoto={version:'3.1.5'};
$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend(
{.. deeplinking: false; ...}  
于 2013-12-20T09:02:41.240 に答える
0

このようなものは機能しますか?

(function($) {
    console.log('check');

    $.prettyPhoto = {
        version : '3.1.5'
    };

    $.fn.prettyPhoto = function(pp_settings) {
        pp_settings = $.extend({
            deeplinking : false
        });
    };

    $("a[rel^='prettyPhoto']").prettyPhoto();

})(jQuery);  
于 2014-01-09T20:44:16.720 に答える