Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery PrettyPhoto removing #prettyphoto from URL

I use version 3.1.4 of prettyphoto. (http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/). I want to remove "#prettyphoto[iframe]/number/" from URL. I've set deeplinking:false but this don't help. I've understood that it might be the problem from these functions:

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";}

Any idea?

like image 257
Pascut Avatar asked Dec 16 '22 17:12

Pascut


2 Answers

This is my code and it worked for me:

    <script type="text/javascript" charset="utf-8">
      $(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto({
        social_tools:false,
        deeplinking:false});
      });
    </script>
like image 121
George Avatar answered Dec 18 '22 09:12

George


a) This worked for me:

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

This code is at the bottom of jquery.prettyPhoto.js

b) There is another way, like setting: deeplinking: false at the beginning of jquery.prettyPhoto.js.

I mean here:

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

Hope I helped.

like image 44
Pascut Avatar answered Dec 18 '22 11:12

Pascut