Hi folks ..
Iam pretty new to this JS development .. here Iam trying one simple program like there is one table with a mouse over event ad this mouse over event is having a function like on mouseover the height of the table increased to 100px and this height incremented to 100px on every mouse over.
then i include a if condition which tells the browser to shrink the table height to 50px once it is reached to 1000px of height. But this logic is happening for only one time … after the table shrinks to 50px height if i mouse over the logic is not working … please folks explain why this not happening
var x = 0;
function growthHeight() {
x = x + 100;
document.getElementById(‘table’).style.height=x+”px”;
if (x>=1000)
{
document.getElementById(‘table’).style.height=50+”px”;
}
}
<BODY>
<table id=”table” onmouseover=”growthHeight()” style=”border:1px solid #456466; height:50px;” >
<tr><td valign=”bottom” ><div>he he he he</div></td></tr>
</table>
</BODY>