Team:Tsinghua/header
From 2011.igem.org
(Difference between revisions)
GuoQiangChen (Talk | contribs) |
GuoQiangChen (Talk | contribs) |
||
Line 36: | Line 36: | ||
<script> | <script> | ||
$('li[id*="nav-"]').hover(function(){ | $('li[id*="nav-"]').hover(function(){ | ||
+ | var dpad = 0; | ||
try{ | try{ | ||
- | + | dpad = $(this).children()[0].innerHTML.length * 2; | |
- | + | ||
} | } | ||
catch(e){} | catch(e){} | ||
- | $(this).animate({"fontSize": "22px", "paddingTop": "4px", "paddingLeft": | + | dpad = 25 - dpad; |
+ | dpad = dpad + "px"; | ||
+ | $(this).animate({"fontSize": "22px", "paddingTop": "4px", "paddingLeft": dpad, "paddingRight": dpad}, 400, function(){ | ||
$(this).animate({"fontSize": "18px", "paddingTop": "5px", "paddingLeft": "25px", "paddingRight": "25px"}, 200)}); | $(this).animate({"fontSize": "18px", "paddingTop": "5px", "paddingLeft": "25px", "paddingRight": "25px"}, 200)}); | ||
}, function(){}); | }, function(){}); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 13:24, 17 August 2011