Team:NYMU-Taipei/Navigation
From 2013.igem.org
(Difference between revisions)
Mastershot (Talk | contribs) |
Mastershot (Talk | contribs) |
||
Line 229: | Line 229: | ||
<html> | <html> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | + | $(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(){ | |
- | + | var $elem = $(this); | |
- | + | $elem.find('img') | |
- | + | .stop(true) | |
- | + | .animate({ | |
- | + | 'width':'127px', | |
- | + | 'height':'127px', | |
- | + | 'left':'0px' | |
- | + | },400,'easeOutBack') | |
- | + | .andSelf() | |
- | + | .find('.sdt_wrap') | |
- | + | .stop(true) | |
- | + | .animate({'top':'90px'},500,'easeOutBack') | |
- | + | .andSelf() | |
- | + | .find('.sdt_active') | |
- | + | .stop(true) | |
- | + | .animate({'height':'127px'},200,function(){ | |
- | + | var $sub_menu = $elem.find('.sdt_box'); | |
- | + | if($sub_menu.length){ | |
- | + | var left = '127px'; | |
- | + | if($elem.parent().children().length == $elem.index()+1) | |
- | + | left = '-127px'; | |
- | + | $sub_menu.show().animate({'left':left},100,function(){ | |
- | + | var $sub_link = $sub_menu.find('a'); | |
- | + | $sub_link.hover(function(){ | |
- | + | $secsub_menu = $sub_link.next().find('.sdt_secsub'); | |
- | + | if($secsub_menu.length){ | |
- | + | var left_s = '254px'; | |
- | + | if($elem.parent().children().length == $elem.index()+1) | |
- | + | var left_s = '-254px'; | |
- | + | $secsub_menu.show().animate({'left':left_s},100); | |
- | + | } | |
- | + | }) | |
- | + | }) | |
- | + | } | |
- | + | }) | |
- | + | }).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