Example:You can test it by changing url of image.
<html>
<head>
</head>
<body>
<img src="a1.jpg" width="300px" onmouseover="this.width=500" onmouseout="this.width=300">
</body>
</html>
Do not change value of src in img tag of ur code.
Just add onmouseover and onmouseout to img tag like
onmouseover="this.width=NewWidth" onmouseout="this.width=OriginalWidth"
and
replace OriginalWidth with original width of ur image and NewWidth with what width u want it to enlarge to. browser will automatically calculate correct height itself.
<html>
<head>
</head>
<body>
<img src="a1.jpg" width="300px" onmouseover="this.width=500" onmouseout="this.width=300">
</body>
</html>
Do not change value of src in img tag of ur code.
Just add onmouseover and onmouseout to img tag like
onmouseover="this.width=NewWidth" onmouseout="this.width=OriginalWidth"
and
replace OriginalWidth with original width of ur image and NewWidth with what width u want it to enlarge to. browser will automatically calculate correct height itself.