EstebanDLPT (Talk | contribs) m |
EstebanDLPT (Talk | contribs) m |
||
Line 244: | Line 244: | ||
$(window).scroll(function(event) { | $(window).scroll(function(event) { | ||
var scroll = $(window).scrollTop(); | var scroll = $(window).scrollTop(); | ||
+ | var position = document.getElementById("bacteria-nadando").offsetTop; | ||
var scrollOpacity = map(scroll, 0, 350, 1, 0); | var scrollOpacity = map(scroll, 0, 350, 1, 0); | ||
//var scrollFade = map(scroll, 350, 0, 0, 1); | //var scrollFade = map(scroll, 350, 0, 0, 1); | ||
Line 249: | Line 250: | ||
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 (position > final) { |
$('#bacteria-nadando ').css('opacity','0'); | $('#bacteria-nadando ').css('opacity','0'); | ||
} else { | } else { |
Revision as of 22:31, 12 October 2018