css - Float Menu like on TheVerge reviews posts Jquery -


i have code this:

$(".jumper").on("click", function( e ) {  e.preventdefault();  $("body, html").animate({      scrolltop: $( $(this).attr('href') ).offset().top  }, 600);  }); 

this how it's going work http://jsfiddle.net/zvdrt/291/

how make menu change backgorund of pilip or ploop when rich specific level?

sorry language;) here example of theverge float menu in post http://www.theverge.com/2014/4/14/5608222/samsung-galaxy-s5-review

if understood correctly, want change background of link once reaches destination (end of scroll). can done using complete function of animate:

$(".jumper").on("click", function( e ) {      e.preventdefault();      // reset background jumpers, , save current 1     $(".jumper").css("background","");     obj = this;      $("body, html").animate(         {              scrolltop: $( $(this).attr('href') ).offset().top          },          600,          function() {             // change background current jumper when animation completed             $(obj).css("background","black");         });  }); 

i hope meant. can see working on link: http://jsfiddle.net/zvdrt/298/ (i added z-index #menu css keywords wouldn't overlap it.)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -