• I’d like to have the address bar reflect the clicked url upon activating that anchor. For instance, you have www.page.com with an #intro section and when clicking the link, your address bar will change to www.page.com/#intro. Is this possible?

Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    It’s possible if you can add a few lines of javascript in your theme.
    For example, adding the following script in your theme’s footer.php just before the closing body tag, will do exactly what you need:

    
    <script>
    (function($){
      $(window).load(function(){
        $(document).data("mPS2id").onStart=function(){
          if(window.history && window.history.pushState) history.pushState("","",$(".mPS2id-clicked").attr("href"));
        }
      });
    })(jQuery);
    </script>
    

    Let me know if this helps

Viewing 1 replies (of 1 total)

The topic ‘Change URL on link activation / click’ is closed to new replies.