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?

Related posts

Leave a Reply

4 comments

  1. 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>
    
  2. 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.

  3. 3.1.5 version will work

    (function($){$.prettyPhoto={version:'3.1.5'};
    $.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend(
    {.. deeplinking: false; ...}  
    
  4. Would something like this work?

    (function($) {
        console.log('check');
    
        $.prettyPhoto = {
            version : '3.1.5'
        };
    
        $.fn.prettyPhoto = function(pp_settings) {
            pp_settings = $.extend({
                deeplinking : false
            });
        };
    
        $("a[rel^='prettyPhoto']").prettyPhoto();
    
    })(jQuery);