Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
 
(12 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: '-=75%'}, 800, function(){$('.spiderbutton').stop(true,true).animate({ top: '+=75%'}, 3000)});
+
           $('.spiderbutton').stop(true,true).animate({ top: '-=55%'}, 800, function(){$('.spiderbutton').stop(true,true).animate({ top: '+=55%'}, 3000)});
-
           $('.spiderline').stop(true,true).animate({ top: '-=75%'}, 800, function(){$('.spiderline').stop(true,true).animate({ top: '+=75%'}, 3000)});
+
           $('.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() {
-
     $('#hp .slider_left').mouseenter(function(){
+
     $('.hpslider_left').mouseenter(function(){
-
           $('#hp .slider_left').animate({ opacity: '0.8'},1);
+
           $('.hpslider_left').animate({ opacity: '0.8'},1);
     });
     });
-
     $('.slider_right').mouseenter(function(){
+
     $('.hpslider_right').mouseenter(function(){
-
           $('#hp .slider_right').animate({ opacity: '0.8'},1);
+
           $('.hpslider_right').animate({ opacity: '0.8'},1);
     });
     });
-
     $('.slider_left').mouseleave(function(){
+
     $('.hpslider_left').mouseleave(function(){
-
           $('#hp .slider_left').animate({ opacity: '0.5'},1);
+
           $('.hpslider_left').animate({ opacity: '0.5'},1);
     });
     });
-
     $('#hp .slider_right').mouseleave(function(){
+
     $('.hpslider_right').mouseleave(function(){
-
           $('#hp .slider_right').animate({ opacity: '0.5'},1);
+
           $('.hpslider_right').animate({ opacity: '0.5'},1);
     });
     });
-
     var total = $('#hp .slider_imgs > td').length;
+
     var total = $('.hpslider_imgs > td').length;
     var count = 0;
     var count = 0;
-
     $('#hp .slider_left').click(function(){
+
     $('.hpslider_left').click(function(){
         if(count > 0){
         if(count > 0){
-
             $('#hp .slider_imgs').stop(true,true).animate({ left: '+=1150px'}, 250);
+
             $('.hpslider_imgs').stop(true,true).animate({ left: '+=1150px'}, 250);
             count -= 1;
             count -= 1;
         } else{
         } else{
-
             $('#hp .slider_imgs').stop(true,true).animate({ left: '+=20px'}, 100, function(){$('#hp .slider_imgs').stop(true,true).animate({ left: '-=20px'}, 500)});
+
             $('.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)});
         }
         }
     });
     });
-
     $('#hp .slider_right').click(function(){
+
     $('.hpslider_right').click(function(){
-
         if(count < 2){
+
         if(count < 14){
-
             $('#hp .slider_imgs').stop(true,true).animate({ left: '-=1150px'}, 250);
+
             $('.hpslider_imgs').stop(true,true).animate({ left: '-=1150px'}, 250);
             count += 1;
             count += 1;
         } else{
         } else{
-
             $('#hp .slider_imgs').stop(true,true).animate({ left: '+=2300px'}, 250);
+
             $('.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