Difference between revisions of "Template:Toronto/Javascript"

Line 19: Line 19:
 
    
 
    
  
     
+
var prop=0;
 +
 
 
$(window).scroll(function() {
 
$(window).scroll(function() {
  console.log($(window).scrollTop());
 
  if ($(window).scrollTop() > 500px) {
 
    $("#nugget").fadeOut("slow");
 
    $(".testtext").delay(500).fadeIn("slow");
 
}
 
});
 
  
 +
prop= ($(window).scrollTop() + $(window).height()/$(document).height());
 +
    $("#nugget").css('opacity') = prop.toString();;
 +
    $(".testtext").css('opacity') = (1-prop).toString();;
 +
 +
}
  
 
});
 
});

Revision as of 20:16, 8 August 2016