×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: curtis allen
Added: Nov 27, 2013 2:37 PM
Views: 11
Tags: no tags
  1. function _addSticky() {
  2.     var w = $(window).width(),
  3.         h = $('#SiteHeader').outerHeight(),
  4.         stick = $('#stickyNav');
  5.         if(w > 962 ) {
  6.  
  7.        ($(window).scrollTop() > h) ? stick.addClass( "affix" ) : stick.removeClass( "affix" );
  8.  
  9.         }
  10. }
  11.  
  12.  
  13. $(window).scroll(function() {
  14.         _addSticky();
  15. });