Team:UCLA/anuved verma ucla2014 workspace/Javascript
From 2014.igem.org
(Difference between revisions)
Anuvedverma (Talk | contribs) |
Anuvedverma (Talk | contribs) |
||
(41 intermediate revisions not shown) | |||
Line 4: | Line 4: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
jQuery(document).ready(function($){ | jQuery(document).ready(function($){ | ||
- | $('.spiderbutton').click(function(){ | + | $('.spiderbutton, .backtotop').click(function(){ |
+ | $('.spiderbutton').stop(true,true).animate({ top: '-=60%'}, 800, function(){$('.spiderbutton').stop(true,true).animate({ top: '+=60%'}, 3000)}); | ||
+ | $('.spiderline').stop(true,true).animate({ top: '-=60%'}, 800, function(){$('.spiderline').stop(true,true).animate({ top: '+=60%'}, 3000)}); | ||
$("html, body").animate({ scrollTop: 0 }, 500); | $("html, body").animate({ scrollTop: 0 }, 500); | ||
- | |||
- | |||
}); | }); | ||
}); | }); | ||
</script> | </script> | ||
+ | |||
+ | |||
<!--SPLASH PAGE--> | <!--SPLASH PAGE--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 43: | Line 45: | ||
<!--MAIN PAGE BOXES--> | <!--MAIN PAGE BOXES--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | $(document).ready(function(){ | + | $(document).ready(function() { |
- | + | $('#box5').hover(function(){ | |
- | + | var smallTop = $('#box5').height() - $(".cover", this).height() -10 +"px"; | |
- | + | $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160}); | |
- | + | }, function() { | |
+ | $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160}); | ||
}); | }); | ||
- | + | $('#box6').hover(function(){ | |
- | + | var smallTop = $('#box6').height() - $(".cover", this).height() -10 +"px"; | |
- | + | $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160}); | |
- | + | }, function() { | |
+ | $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160}); | ||
}); | }); | ||
- | }); | + | $('#box7').hover(function(){ |
+ | var smallTop = $('#box7').height() - $(".cover", this).height() -10 +"px"; | ||
+ | $(".cover", this).stop().animate({top:smallTop},{queue:false,duration:160}); | ||
+ | }, function() { | ||
+ | $(".cover", this).stop().animate({top:'340px'},{queue:false,duration:160}); | ||
+ | }); | ||
+ | }); | ||
</script> | </script> | ||
Line 67: | Line 77: | ||
}).mouseleave(function(){ | }).mouseleave(function(){ | ||
$("#side_menu").stop(true,false).animate({ | $("#side_menu").stop(true,false).animate({ | ||
- | left:'- | + | left:'-170px', |
}); | }); | ||
}); | }); | ||
Line 78: | Line 88: | ||
$("#menu > li > ul").hide(); | $("#menu > li > ul").hide(); | ||
$("#menu > li").mouseenter(function() { | $("#menu > li").mouseenter(function() { | ||
- | $(this).children("li > ul").stop(true, | + | $(this).children("li > ul").stop(true,true).slideDown(350); |
}); | }); | ||
$("#menu > li").mouseleave(function() { | $("#menu > li").mouseleave(function() { | ||
- | $(this).children("li > ul").stop(true, | + | $(this).children("li > ul").stop(true,true).slideUp(350); |
}); | }); | ||
}); | }); | ||
Line 140: | Line 150: | ||
</script> | </script> | ||
- | <!-- | + | |
+ | |||
+ | <!--SLIDER--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | + | $('.slider_left').mouseenter(function(){ | |
- | + | $('.slider_left').animate({ opacity: '0.8'},1); | |
- | + | }); | |
- | + | $('.slider_right').mouseenter(function(){ | |
- | + | $('.slider_right').animate({ opacity: '0.8'},1); | |
- | + | }); | |
- | + | $('.slider_left').mouseleave(function(){ | |
- | + | $('.slider_left').animate({ opacity: '0.5'},1); | |
- | + | }); | |
- | + | $('.slider_right').mouseleave(function(){ | |
- | + | $('.slider_right').animate({ opacity: '0.5'},1); | |
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | |||
- | |||
- | |||
- | + | var total = $('.slider_imgs > td').length; | |
+ | var count = 0; | ||
+ | $('.slider_left').click(function(){ | ||
+ | if(count > 0){ | ||
+ | $('.slider_imgs').stop(true,true).animate({ left: '+=1150px'}, 250); | ||
+ | count -= 1; | ||
+ | } else{ | ||
+ | $('.slider_imgs').stop(true,true).animate({ left: '+=20px'}, 100, function(){$('.slider_imgs').stop(true,true).animate({ left: '-=20px'}, 500)}); | ||
} | } | ||
- | + | }); | |
- | }; | + | $('.slider_right').click(function(){ |
+ | if(count < 2){ | ||
+ | $('.slider_imgs').stop(true,true).animate({ left: '-=1150px'}, 250); | ||
+ | count += 1; | ||
+ | } else{ | ||
+ | $('.slider_imgs').stop(true,true).animate({ left: '+=2300px'}, 250); | ||
+ | count = 0; | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | + | <!--PAGE HEADERS--> | |
- | + | <script type="text/javascript"> | |
- | }; | + | $(document).ready(function() { |
+ | $('.page_header_box').mouseenter(function(){ | ||
+ | $(this).animate({ opacity: '0.9'},1); | ||
+ | }); | ||
+ | $('.page_header_box').mouseleave(function(){ | ||
+ | $(this).animate({ opacity: '0.5'},1); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
</html> | </html> |
Latest revision as of 19:55, 20 September 2014