我想設計一個菜單,當我懸停一個鏈接,鏈接推進,當我將鼠標移出,鏈接向後移動。填充菜單通過JQuery
我知道我能做到這一點與.hover function.I不想使用jQuery事件。我只想使用它們嵌入在html標籤中的javascript事件。
這裏是我的嘗試:
<script type="text/javascript">
function MIn()
{
jQuery(this).animate({paddingLeft:"20px"},500);
}
function MOut()
{
jQuery(this).animate({paddingLeft:"0px"},500);
}
</script>
</head>
<body>
<ul>
<li onmouseover = "MIn()" onmouseout="MOut()" ><a href="#">Home</a></li>
<li onmouseover = "MIn()" onmouseout="MOut()"><a href="#">Download</a></li>
<li onmouseover = "MIn()" onmouseout="MOut()"><a href="#">Products</a></li>
<li onmouseover = "MIn()" onmouseout="MOut()"> <a href="#">Register</a></li>
<li onmouseover = "MIn()" onmouseout="MOut()"><a href="#">About</a></li>
<li onmouseover = "MIn()" onmouseout="MOut()"><a href="#">Contact</a></li>
</ul>
</body>
什麼不起作用? – locrizak 2012-02-01 15:02:46
鏈接不會被填充! – sap 2012-02-01 15:03:36