I want to design a menu that when I hover a link , the link pushed forward and when I move the mouse out of that , the link moves backward.
I know I can done that with .hover function.I don’t want to use jQuery Events. I want to use just javascript events that they are embed in html tags.
here is my attempt:
<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>
You couldnt use jQuery(this) in javascript function wout jQuery selector. You have to send element like this.