Difference between revisions of "Team:Cambridge-JIC/TestHome"
Line 38: | Line 38: | ||
$(this).css("cursor", "pointer") | $(this).css("cursor", "pointer") | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}) | }) | ||
Line 65: | Line 56: | ||
$("#sidebar").append("<div class=\"sidebar-item\"></div>") | $("#sidebar").append("<div class=\"sidebar-item\"></div>") | ||
} | } | ||
+ | }) | ||
+ | |||
+ | |||
+ | |||
+ | $(window).on("scroll", function(){ | ||
+ | var i=0; | ||
+ | $("section").each(function(){ | ||
+ | if($(this).offset().top < $(window).scrollTop()) { | ||
+ | $(".sidebar-item").css("background", "none") | ||
+ | alert(i) | ||
+ | } | ||
+ | i++; | ||
+ | }) | ||
+ | }).scroll() | ||
+ | |||
+ | $(window).on("scroll", function(){ | ||
+ | |||
+ | $('.downarrow').each(function(){ | ||
+ | var position = $(this).offset().top +$(this).height()/2 - $(window).scrollTop(); | ||
+ | $(this).css("opacity", position/$(window).height()) | ||
+ | }) | ||
+ | |||
}) | }) | ||
Revision as of 02:09, 4 August 2015