Difference between revisions of "Team:Cambridge-JIC"
Line 69: | Line 69: | ||
var i=0; | var i=0; | ||
$("section").each(function(){ | $("section").each(function(){ | ||
− | if($(this).offset().top <= $(window).scrollTop()) { | + | if($(this).offset().top <= $(window).scrollTop() + ($(window).height()/2)) { |
$(".sidebar-item").css("background", "none") | $(".sidebar-item").css("background", "none") | ||
$($(".sidebar-item").get(i)).css("background", "#555") | $($(".sidebar-item").get(i)).css("background", "#555") |
Revision as of 14:34, 4 August 2015