אין לי ממש רעיון איך להסביר את זה יותר טוב אז אני פשוט אראה לך...
HTML קוד:
<html dir=rtl>
<head>
<script language="javascript">
function func(id)
{
var pic = document.getElementById(id).style;
pic.width="150px";
pic.height="150px";
}
function func2(id)
{
var pic = document.getElementById(id).style;
pic.width="500px";
pic.height="500px";
}
</script>
</head>
<body link="blue" alink="blue" vlink="blue">
<font size="5" face="arial">
<center>
<h1>גלרית תמונות</h1>
<h3> להגדלה עבור על התמונה עם העכבר </h3>
<hr size="3" color="gold"> <br>
<table align="center" border="1" cellspacing="10">
<tr align="center">
<td>
<img id="pic1" src="images/gallery/1.jpg" border="0" OnMouseOver="func2('pic1')" OnMouseOut="func('pic1')" width="150" height="150">
</td>
<td>
<img id="pic2" src="images/gallery/2.jpg" border="0" OnMouseOver="func2('pic2')" OnMouseOut="func('pic2')" width="150" height="150">
</td>
</tr>
</table>
</font>
</center>
</body>
</html>
ד"א אתה יכול לעשות את זה עם פונקציה אחת...
HTML קוד:
<script type="text/javascript">
function func(id)
{
var pic = document.getElementById(id).style;
if(pic.width == "150px")
{
pic.width="500px";
pic.height="500px";
}
else
{
pic.width="150px";
pic.height="150px";
}
}
</script>