반응형
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
반응형
'programing' 카테고리의 다른 글
입력 키에서 양식 제출 금지 (0) | 2023.03.06 |
---|---|
Spring Boot 2.0.0, Data Source Builder를 autoconfigure jar에서 찾을 수 없습니다. (0) | 2023.03.06 |
스프링 부츠: 앱을 시작하지 않고 리퀴베이스 이행 실행 (0) | 2023.03.06 |
WooCommerce에서 모든 제품 카테고리 가져오기 (0) | 2023.03.06 |
Angular에서의 비싱글톤 서비스JS (0) | 2023.03.06 |