Team:UCLA/anuved verma ucla2014 workspace/Javascript
From 2014.igem.org
(Difference between revisions)
Anuvedverma (Talk | contribs) |
Anuvedverma (Talk | contribs) |
||
(24 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)}); | $('.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)}); | $('.spiderline').stop(true,true).animate({ top: '-=60%'}, 800, function(){$('.spiderline').stop(true,true).animate({ top: '+=60%'}, 3000)}); | ||
Line 11: | Line 11: | ||
}); | }); | ||
</script> | </script> | ||
+ | |||
+ | |||
<!--SPLASH PAGE--> | <!--SPLASH PAGE--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
Line 75: | Line 77: | ||
}).mouseleave(function(){ | }).mouseleave(function(){ | ||
$("#side_menu").stop(true,false).animate({ | $("#side_menu").stop(true,false).animate({ | ||
- | left:'- | + | left:'-170px', |
}); | }); | ||
}); | }); | ||
Line 148: | 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)}); | |
- | + | ||
- | + | ||
- | + | ||
- | var | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | if ( | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
- | + | }); | |
- | }; | + | $('.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