Team:Tsinghua/header
From 2011.igem.org
(Difference between revisions)
Line 36: | Line 36: | ||
<script> | <script> | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
- | $("#catlinks").remove(); | + | $("#catlinks").remove(); |
- | + | $("a").hover(function(){ | |
- | $("a").hover(function(){ | + | try{ |
- | + | $(this).find('div.div-tip').css("display", "block"); | |
- | + | }catch(e){} | |
- | + | }, function(){ | |
- | }, function(){ | + | try{ |
- | + | $(this).find('div.div-tip').css("display", "none"); | |
- | + | }catch(e){} | |
- | + | }); | |
- | }); | + | |
}); | }); | ||
$('li[id*="nav-"]').hover(function(){ | $('li[id*="nav-"]').hover(function(){ | ||
- | var dpad = 0; | + | var dpad = 0; |
- | dpad = Math.round($(this).attr("offsetWidth")/19); | + | dpad = Math.round($(this).attr("offsetWidth")/19); |
- | if(isNaN(dpad)) | + | if(isNaN(dpad)) |
- | + | dpad = Math.round($(this)[0].offsetWidth / 19); | |
- | dpad = Math.round($(this)[0].offsetWidth / 19); | + | dpad = 25 - dpad; |
- | + | dpad += "px"; | |
- | dpad = 25 - dpad; | + | $(this).animate({"fontSize": "22px", "paddingTop": "4px", "paddingLeft": dpad, "paddingRight": dpad}, 400, function(){ |
- | dpad += "px"; | + | $(this).animate({"fontSize": "18px", "paddingTop": "5px", "paddingLeft": "25px", "paddingRight": "24px"}, 200)}); |
- | $(this).animate({"fontSize": "22px", "paddingTop": "4px", "paddingLeft": dpad, "paddingRight": dpad}, 400, function(){ | + | }, function(){}); |
- | + | ||
- | }, function(){}); | + | |
</script> | </script> | ||
<img id="wprint" src="https://static.igem.org/mediawiki/2011/e/eb/Sh3.png" /> | <img id="wprint" src="https://static.igem.org/mediawiki/2011/e/eb/Sh3.png" /> | ||
</html> | </html> |
Revision as of 15:48, 16 September 2011