Team:SYSU-Software/home.js

From 2014.igem.org

Revision as of 09:49, 1 October 2014 by Lskim (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

jQuery(document).ready(function ($) {

 $('#nav > div').hover(
   function () {
       var $this = $(this);

$this.find('h2').animate({'opacity':'0'});

       $this.find('img').stop().animate({
           'width'     :'252px',
           'height'    :'252px',
           'top'       :'-25px',
           'left'      :'-25px',
           'opacity'   :'1.0'
       },400,'easeOutBack',function(){
       $(this).parent().find('ul').fadeIn(400);
       });
       $this.find('a:first').addClass('active');
   },
   function () {
       var $this = $(this);
       $this.find('ul').fadeOut(10);
       $this.find('img').stop().animate({
           'width'     :'0px',
           'height'    :'0px',
           'top'       :'0px',
           'left'      :'27px',
           'opacity'   :'0.1'
       },5000,'easeOutBack');

$this.find('h2').animate({'opacity':'1'});

       $this.find('a:first').removeClass('active');
   }
 );

});