PDA

View Full Version : onmouseover is working but onmouseout is not working.



vaibhavbthl
07-19-2012, 07:42 AM
Hello

I am creating add to cart paypal button with javascript in it. My code is working fine only in opera mini but not in firefox, chrome & IE. Problem is that onmouseover is working but onmouseout is not working. Following is the code -


<form target="paypal" action="*******" method="post">
<input type="hidden" name="*****" value="******">
<input type="hidden" name="*******" value="********">
<input type="image" src="http://images.mydomain.com/Add%20To%20Cart.png" border="0" name="submit" alt="Add to Cart" onmouseover=javascript:this.src='http://images.mydomain.com/Add%20To%20Cart%20Hover.png';onmouseout="javascript:this.src='http://images.mydomain.com/Add%20To%20Cart.png';">
</form>

Thanks

devnull69
07-19-2012, 07:47 AM
Maybe it's the missing double quotes and the missing space before onmouseout


onmouseover="this.src='http://images.mydomain.com/Add%20To%20Cart%20Hover.png';" onmouseout="this.src='http://images.mydomain.com/Add%20To%20Cart.png';"

vaibhavbthl
07-19-2012, 08:37 AM
Thank You very much devnull69 for your quick response and easy fix. Now my button is working correctly in all browsers.