EstebanDLPT (Talk | contribs) m |
EstebanDLPT (Talk | contribs) m |
||
Line 259: | Line 259: | ||
$(window).scroll(function(event) { | $(window).scroll(function(event) { | ||
− | + | var hiding = document.getElementById("hiding-block"); | |
− | + | var hidingPos = hiding.offsetTop; | |
− | + | var bacteriaPos = document.getElementById("bacteria-nadando").offsetTop; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
var scroll = $(window).scrollTop(); | var scroll = $(window).scrollTop(); | ||
Line 273: | Line 269: | ||
var bacteriaTop = map(scroll, 900, 2000, -100, 100); | var bacteriaTop = map(scroll, 900, 2000, -100, 100); | ||
var bacteriaRotate = map(scroll, 0, 700, 50, 0); | var bacteriaRotate = map(scroll, 0, 700, 50, 0); | ||
− | if ( | + | if (bacteriaPos > hidingPos) { |
$('#bacteria-nadando ').css('opacity','0'); | $('#bacteria-nadando ').css('opacity','0'); | ||
} else { | } else { |
Revision as of 18:44, 13 October 2018