trollolodn

#html - circle template - fix scroll and link

Jul 8th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //added and overwrite to jquery.v.js file
  2.  
  3. jQuery.noConflict();
  4.  
  5. (function($) {
  6.   $(function() {
  7.  
  8.     $(window).scroll(function(){
  9.         a = $(this);
  10.         if(a.scrollTop() > 140){
  11.             $('#top-nav').addClass('fixed');
  12.         } else{
  13.             $('#top-nav').removeClass('fixed');
  14.         }
  15.     });
  16.     $('.menu-primary-container a').click(function(){
  17.         var url = $(this).attr("href");
  18.         document.location.href=url;
  19.     });
  20.   });
  21. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment