EduardET

Untitled

Jun 14th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. (function($) {
  3.     $(document).ready(function() {
  4.         var address = window.location.href,
  5.             links = $('#top-menu li a');
  6.         function changeurl(menu_link) {
  7.             var new_url = address + menu_link;
  8.             window.history.pushState("data","Title",new_url);
  9.         }
  10.         links.each(function(){
  11.             $(this).click(function(){
  12.                 var scroll_to = $(this).attr("href");
  13.                 changeurl(scroll_to);
  14.             });
  15.         });
  16.     });
  17. })(jQuery);
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment