Team:UCLA/Template/Javascript
From 2014.igem.org
(Difference between revisions)
Anuvedverma (Talk | contribs) |
Samichaels (Talk | contribs) |
||
Line 91: | Line 91: | ||
},4000); | },4000); | ||
} | } | ||
+ | </script> | ||
+ | |||
+ | <!-- SAM'S CAROUSEL EDIT SORRY AGAIN --> | ||
+ | <script type="text/javascript"> | ||
+ | $(".scroll").click(function(event){ | ||
+ | event.preventDefault(); | ||
+ | //calculate destination place | ||
+ | var dest=0; | ||
+ | if($(this.hash).offset().top > $(document).height()-$(window).height()){ | ||
+ | dest=$(document).height()-$(window).height(); | ||
+ | }else{ | ||
+ | dest=$(this.hash).offset().top; | ||
+ | } | ||
+ | //go to destination | ||
+ | $('html,body').animate({scrollTop:dest}, 700,'swing'); | ||
+ | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 00:07, 2 August 2014