PDA

View Full Version : باز شدن یک div بصورت آهسته



nice_o0
جمعه 18 دی 1388, 16:49 عصر
باز شدن یک div بصورت آهسته ، تقریبا مثل منوهای آکاردئونی .ممنون

exlord
دوشنبه 09 فروردین 1389, 14:35 عصر
این کد سادشه ولی بهتره از jquery یا mootools استفاده کنی....

<html>
<head>
<script language="javascript" type="text/javascript">
var h = 0;
var max = 100;
function showMe() {
h++;
document.getElementById('div1').style.height = h + 'px';
if (h == max)
clearInterval(x);
}
function doIt() {
x = setInterval('showMe()', 10);
}
</script>
</head>
<body onload="doIt();">
<div id="div1" style=" width: 100px; height: 0px; background-color: Aqua;">
</div>
</body>
</html>