---menu---
::Headlines Reviews :
Home » » fixed nav test

fixed nav test

Blog | Sunday, June 8, 2014 | ---

---
Test













=======================
1
========================

 $(window).bind('scroll', function() {
         if ($(window).scrollTop() > 50) {
             $('.menu').addClass('fixed');
         }
         else {
             $('.menu').removeClass('fixed');
         }
    });

============================
2
================================
$(document).ready(function() {
  var navpos = $('#mainnav').offset();
  console.log(navpos.top);
    $(window).bind('scroll', function() {
      if ($(window).scrollTop() > navpos.top) {
        $('#mainnav').addClass('fixed');
       }
       else {
         $('#mainnav').removeClass('fixed');
       }
    });
});
================================



Share this article :

0 comments:

Speak up your mind

Tell us what you're thinking... !

 
Sitemap : Home | World reviews | Deportes
Tech Blog
Copyright © 2011-2014. Tutornesio - All Rights Reserved
Tutornecio Blog Index Archive