Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
 
(8 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: '+=50%'}, 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 185: Line 185:
         } else{
         } else{
             $('.slider_imgs').stop(true,true).animate({ left: '+=3450px'}, 250);
             $('.slider_imgs').stop(true,true).animate({ left: '+=3450px'}, 250);
 +
            count = 0;
 +
        }
 +
    });
 +
  });
 +
</script>
 +
 +
 +
<!--HP SLIDER-->
 +
<script type="text/javascript">
 +
  $(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 = $('.hpslider_imgs > td').length;
 +
    var count = 0;
 +
    $('.hpslider_left').click(function(){
 +
        if(count > 0){
 +
            $('.hpslider_imgs').stop(true,true).animate({ left: '+=1150px'}, 250);
 +
            count -= 1;
 +
        } 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 < 14){
 +
            $('.hpslider_imgs').stop(true,true).animate({ left: '-=1150px'}, 250);
 +
            count += 1;
 +
        } else{
 +
            $('.hpslider_imgs').stop(true,true).animate({ left: '+=16100px'}, 250);
             count = 0;
             count = 0;
         }
         }

Latest revision as of 02:45, 18 October 2014