من اومدم كه كد رو براتون بذارم ديدم org.kiani عزيز هم اين كار رو كردند. حالا ضرر نداره! ميشه 2 تا نمونه!!
<html>
<head>
<script language="javascript" type="text/javascript">
var width = 100;
function display(){
var el = document.getElementById("HiddenDiv");
var btn=document.getElementById("btnShow");
if (btn.value=='<<')
{
if (width<50)
{
btn.value = ">>";
clearTimeout("display()");
} else {
width--;
el.style.width = width;
setTimeout("display()",1);
}
}
else
{
if (width>=100)
{
btn.value = "<<";
clearTimeout("display()");
} else {
width++;
el.style.width = width;
setTimeout("display()",1);
}
}
}
display()
-->
</script>
</head>
<body>
<div id="HiddenDiv" style=" border-right: thin solid;
border-top: thin solid;
border-left: thin solid;
border-bottom: thin solid;
width: 100px;
height: 50px;
background-color: #ff6666">
</div>
<br />
<input id="btnShow" type="button" value="<<" onclick="return display()" />
</body>
</html>