Team:UCLA/Template/Javascript
From 2014.igem.org
(Difference between revisions)
Anuvedverma (Talk | contribs) |
Anuvedverma (Talk | contribs) |
||
(11 intermediate revisions not shown) | |||
Line 5: | Line 5: | ||
jQuery(document).ready(function($){ | jQuery(document).ready(function($){ | ||
$('.spiderbutton, .backtotop').click(function(){ | $('.spiderbutton, .backtotop').click(function(){ | ||
- | $('.spiderbutton').stop(true,true).animate({ top: '-= | + | $('.spiderbutton').stop(true,true).animate({ top: '-=55%'}, 800, function(){$('.spiderbutton').stop(true,true).animate({ top: '+=55%'}, 3000)}); |
- | $('.spiderline').stop(true,true).animate({ top: '-= | + | $('.spiderline').stop(true,true).animate({ top: '-=55%'}, 800, function(){$('.spiderline').stop(true,true).animate({ top: '+=55%'}, 3000)}); |
$("html, body").animate({ scrollTop: 0 }, 1000); | $("html, body").animate({ scrollTop: 0 }, 1000); | ||
}); | }); | ||
Line 190: | Line 190: | ||
}); | }); | ||
</script> | </script> | ||
+ | |||
<!--HP SLIDER--> | <!--HP SLIDER--> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | $(' | + | $('.hpslider_left').mouseenter(function(){ |
- | $(' | + | $('.hpslider_left').animate({ opacity: '0.8'},1); |
}); | }); | ||
- | $('. | + | $('.hpslider_right').mouseenter(function(){ |
- | $(' | + | $('.hpslider_right').animate({ opacity: '0.8'},1); |
}); | }); | ||
- | $('. | + | $('.hpslider_left').mouseleave(function(){ |
- | $(' | + | $('.hpslider_left').animate({ opacity: '0.5'},1); |
}); | }); | ||
- | $(' | + | $('.hpslider_right').mouseleave(function(){ |
- | $(' | + | $('.hpslider_right').animate({ opacity: '0.5'},1); |
}); | }); | ||
- | var total = $(' | + | var total = $('.hpslider_imgs > td').length; |
var count = 0; | var count = 0; | ||
- | $(' | + | $('.hpslider_left').click(function(){ |
if(count > 0){ | if(count > 0){ | ||
- | $(' | + | $('.hpslider_imgs').stop(true,true).animate({ left: '+=1150px'}, 250); |
count -= 1; | count -= 1; | ||
} else{ | } else{ | ||
- | $(' | + | $('.hpslider_imgs').stop(true,true).animate({ left: '-=16100px'}, 250); |
+ | count = 14; | ||
+ | // $('.hpslider_imgs').stop(true,true).animate({ left: '+=20px'}, 100, function(){$('.hpslider_imgs').stop(true,true).animate({ left: '-=20px'}, 500)}); | ||
} | } | ||
}); | }); | ||
- | $(' | + | $('.hpslider_right').click(function(){ |
- | if(count < | + | if(count < 14){ |
- | $(' | + | $('.hpslider_imgs').stop(true,true).animate({ left: '-=1150px'}, 250); |
count += 1; | count += 1; | ||
} else{ | } else{ | ||
- | $(' | + | $('.hpslider_imgs').stop(true,true).animate({ left: '+=16100px'}, 250); |
count = 0; | count = 0; | ||
} | } | ||
Line 229: | Line 232: | ||
}); | }); | ||
</script> | </script> | ||
+ | |||
+ | |||
Latest revision as of 02:45, 18 October 2014