Team:NYMU-Taipei/Navigation

From 2013.igem.org

(Difference between revisions)
Line 229: Line 229:
<html>
<html>
<script type="text/javascript">
<script type="text/javascript">
-
            $(function() {
+
  $(function() {
/**
/**
* for each menu element, on mouseenter,  
* for each menu element, on mouseenter,  
Line 237: Line 237:
* we slide it to the left, otherwise to the right
* we slide it to the left, otherwise to the right
*/
*/
-
                $('#sdt_menu > li').bind('mouseenter',function(){
+
  $('#sdt_menu > li').bind('mouseenter',function(){
-
var $elem = $(this);
+
      var $elem = $(this);
-
$elem.find('img')
+
      $elem.find('img')
-
.stop(true)
+
  .stop(true)
-
.animate({
+
    .animate({
-
'width':'127px',
+
'width':'127px',
-
'height':'127px',
+
'height':'127px',
-
'left':'0px'
+
'left':'0px'
-
},400,'easeOutBack')
+
  },400,'easeOutBack')
-
.andSelf()
+
    .andSelf()
-
.find('.sdt_wrap')
+
  .find('.sdt_wrap')
-
    .stop(true)
+
  .stop(true)
-
.animate({'top':'90px'},500,'easeOutBack')
+
  .animate({'top':'90px'},500,'easeOutBack')
-
.andSelf()
+
  .andSelf()
-
.find('.sdt_active')
+
  .find('.sdt_active')
-
    .stop(true)
+
  .stop(true)
-
.animate({'height':'127px'},200,function(){
+
  .animate({'height':'127px'},200,function(){
-
var $sub_menu = $elem.find('.sdt_box');
+
      var $sub_menu = $elem.find('.sdt_box');
-
if($sub_menu.length){
+
      if($sub_menu.length){
-
var left = '127px';
+
          var left = '127px';
-
if($elem.parent().children().length == $elem.index()+1)
+
  if($elem.parent().children().length == $elem.index()+1)
-
left = '-127px';
+
  left = '-127px';
-
$sub_menu.show().animate({'left':left},100,function(){
+
  $sub_menu.show().animate({'left':left},100,function(){
-
var $sub_link = $sub_menu.find('a');
+
      var $sub_link = $sub_menu.find('a');
-
$sub_link.hover(function(){
+
      $sub_link.hover(function(){
-
$secsub_menu = $sub_link.next().find('.sdt_secsub');
+
          $secsub_menu = $sub_link.next().find('.sdt_secsub');
-
if($secsub_menu.length){
+
  if($secsub_menu.length){
-
var left_s = '254px'
+
      var left_s = '254px';
-
if($elem.parent().children().length == $elem.index()+1)
+
      if($elem.parent().children().length == $elem.index()+1)
-
var left_s = '-254px'
+
          var left_s = '-254px';
-
$secsub_menu.show().animate({'left':left_s},100);
+
      $secsub_menu.show().animate({'left':left_s},100);
-
    }
+
                          }
-
}
+
      })
-
                                                                                }
+
  })
-
});
+
              }
-
                                                                });
+
          })
-
}
+
  }).bind('mouseleave',function(){
-
})
+
-
}).bind('mouseleave',function(){
+
var $elem = $(this);
var $elem = $(this);
var $sub_menu = $elem.find('.sdt_box');
var $sub_menu = $elem.find('.sdt_box');

Revision as of 15:47, 19 September 2013