Team:Tsinghua/header

From 2011.igem.org

(Difference between revisions)
Line 36: Line 36:
<script>
<script>
$('li[id*="nav-"]').hover(function(){
$('li[id*="nav-"]').hover(function(){
 +
var dpad = 0;
try{
try{
-
var dpad = $(this)[0].innerHTML.length * 2;
+
dpad = $(this).children()[0].innerHTML.length * 2;
-
alert(dpad);
+
}
}
catch(e){}
catch(e){}
-
$(this).animate({"fontSize": "22px", "paddingTop": "4px", "paddingLeft": "15px", "paddingRight": "15px"}, 400, function(){
+
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