Difference between revisions of "Team:Cambridge-JIC"

m (removed down arrows)
Line 70: Line 70:
  
  
$(window).on("scroll", function(){
+
$("body").on("scroll", function(){
 
     var i=0;
 
     var i=0;
 
     $("section.dotslide").each(function(){
 
     $("section.dotslide").each(function(){
         if($(this).offset().top <= $(window).scrollTop() + ($(window).height()/3)) {
+
         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:
 
})
 
})
  
$(window).on("scroll", function(){
+
$("body").on("scroll", function(){
  
 
$('.downarrow').each(function(){
 
$('.downarrow').each(function(){
var position = $(this).offset().top +$(this).height()/2 - $(window).scrollTop();
+
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