Animated bars at scroll position
Question by user1375823
I created some animated bars with jquery. I’m only really just learning jQuery & javascript. It was working last night, the bars animated when at a certain scroll position but now it doesn’t work, nothing has been changed. Anyone help me out? Or is there a better way to do it than what I’m doing?
$(document).ready(function(){
$(document).scroll(function() {
var top = $(document).scrollTop();
console.log(top);
if (top > 930) $("#html, #css").animate({width:"100%"}, 2000);
if (top > 930) $("#javascript").animate({width:"70%"}, 2000);
if (top > 930) $("#php").animate({width:"50%"}, 2000);
if (top > 930) $("#mysql").animate({width:"30%"}, 2000);
if (top > 930) $("#wordpress").animate({width:"60%"}, 2000);
});
});
Answer by Starx
You dont seem to hit that 930 margin. Its working fine with 330
margin.