programing

URL에서 #pretty photo를 삭제하는 방법

javamemo 2023. 3. 6. 20:36
반응형

URL에서 #pretty photo를 삭제하는 방법

pretty photo media wordpress plugin (버전 3.1.4)을 사용하고 있습니다.하지만 문제는 이미지를 클릭하면 라이트박스에서 열리면 URL에 #pretty와 같은 태그가 추가된다는 것입니다.Photo [ Landscaping ]/0/그래서 URL은 다음과 같습니다.www.myssite.com/#prettyPhoto[landscaping]/0/.

이 추가 태그를 어떻게 제거할 수 있습니까?여기 내 jquery.pretty의 코드가 있다.Photo.js 파일:

function setHashtag(){
        if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
        location.hash = theRel + '/'+rel_index+'/';
    };

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

어제도 같은 문제가 있었는데 스택오버플로우에서 답을 찾은 게 확실해요정말 많은 웹사이트나 포럼을 방문했는데정확히 어디서 답을 얻었는지 기억이 안 나요.

아무튼 드림위버 작업 중인데 WP에서도 코드가 비슷한 것 같아요.

경우 디플링 속성을 false로 지정하면 됩니다.사진.

코드는 다음과 같습니다.

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

저는 js에 정통한 사람입니다만, 이것이 도움이 되었으면 합니다.

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

deeplinking: false를 사용하여 #prettyphoto를 URL에서 삭제

언급URL : https://stackoverflow.com/questions/16692439/how-to-remove-the-prettyphoto-from-the-url

반응형