Difference between revisions of "Team:Cambridge-JIC"
Simonhkswan (Talk | contribs) m (removed down arrows) |
|||
Line 70: | Line 70: | ||
− | $( | + | $("body").on("scroll", function(){ |
var i=0; | var i=0; | ||
$("section.dotslide").each(function(){ | $("section.dotslide").each(function(){ | ||
− | if($(this).offset().top <= $( | + | if($(this).offset().top <= $("body").scrollTop() + ($(window).height()/3)) { |
$(".sidebar-item").css("background", "none") | $(".sidebar-item").css("background", "none") | ||
$($(".sidebar-item").get(i)).css("background", "#555") | $($(".sidebar-item").get(i)).css("background", "#555") | ||
Line 81: | Line 81: | ||
}) | }) | ||
− | $( | + | $("body").on("scroll", function(){ |
$('.downarrow').each(function(){ | $('.downarrow').each(function(){ | ||
− | var position = $(this).offset().top +$(this).height()/2 - $( | + | var position = $(this).offset().top +$(this).height()/2 - $("body").scrollTop(); |
$(this).css("opacity", position/$(window).height()) | $(this).css("opacity", position/$(window).height()) | ||
}) | }) |
Revision as of 14:54, 16 September 2015