Line 43: | Line 43: | ||
if(!highvisited && currentscroll > 1000 && currentscroll < 1750){ | if(!highvisited && currentscroll > 1000 && currentscroll < 1750){ | ||
highvisited=true; | highvisited=true; | ||
− | $("#highmove").animate({height:"0", width:"0", marginTop:"100px", marginRight:"100px"}, 1000, function(){ | + | //$("#highmove").animate({height:"0", width:"0", marginTop:"100px", marginRight:"100px"}, 1000, function(){ |
+ | // $("#highmove").attr("src","https://static.igem.org/mediawiki/2018/1/17/T--Jiangnan--main--highmove.png"); | ||
+ | //}); | ||
+ | //$("#highmove").animate({height:"400px", width:"400px", marginTop:"0px", marginRight:"0px"}, 1000); | ||
+ | $("#highmove").fadeOut('slow', function(){ | ||
$("#highmove").attr("src","https://static.igem.org/mediawiki/2018/1/17/T--Jiangnan--main--highmove.png"); | $("#highmove").attr("src","https://static.igem.org/mediawiki/2018/1/17/T--Jiangnan--main--highmove.png"); | ||
}); | }); | ||
− | $("#highmove"). | + | $("#highmove").fadeIn(); |
} | } | ||
Revision as of 15:59, 26 June 2018
highvisited = false; susvisited = false; broadvisited = false; $(document).ready(function(){ //in first page, readnext $("#readnext").click(function(){ $("body, html").animate({scrollTop:708},750); }) //in second page,animate js of three stuff in bottom $("#sus").mouseover(function(){ $("#sus").attr("class", "animated infinite swing"); }); $("#sus").mouseout(function(){ $("#sus").attr("class", ""); }); $("#broad").mouseover(function(){ $("#broad").attr("class", "animated infinite pulse"); }); $("#broad").mouseout(function(){ $("#broad").attr("class", ""); }); $("#high").mouseover(function(){ $("#high").attr("class", "animated infinite rubberBand"); }); $("#high").mouseout(function(){ $("#high").attr("class", ""); }); $("#sus").click(function(){ $('body, html').animate({scrollTop:2100},750); }); $("#high").click(function(){ $('body, html').animate({scrollTop:1400}, 500); }); $("#broad").click(function(){ $('body, html').animate({scrollTop:2800}, 1000); });
$('.scrollspy').scrollSpy();
$(this).scroll(function(){
var currentscroll = document.documentElement.scrollTop; if(!highvisited && currentscroll > 1000 && currentscroll < 1750){ highvisited=true; //$("#highmove").animate({height:"0", width:"0", marginTop:"100px", marginRight:"100px"}, 1000, function(){ // $("#highmove").attr("src",""); //}); //$("#highmove").animate({height:"400px", width:"400px", marginTop:"0px", marginRight:"0px"}, 1000); $("#highmove").fadeOut('slow', function(){ $("#highmove").attr("src",""); }); $("#highmove").fadeIn(); }
if(!susvisited && currentscroll > 1800 && currentscroll < 2400){ susvisited=true; $("#susmove").addClass("animated bounceInUp"); }
if(!broadvisited && currentscroll > 2500 && currentscroll < 3200){ broadvisited=true; $("#broadmove").addClass("animated jello"); }
if(currentscroll < 1200){ $("#sideguide").fadeOut(); }else{ $("#sideguide").fadeIn(); } }) });