时间:2021-07-01 10:21:17 帮助过:8人阅读
理解这段代码就基本上掌握了代码如下:
function f_s() {
var obj = document.getElementById("top");
obj.style.display = "block";
obj.style.height = "1px";
var sw = function () {
var s_width = parseInt(obj.style.height);
if (s_width < 350) {
obj.style.height = (s_width + Math.ceil((350 - s_width) / 15)) + "px";
}
else {
clearInterval(st);
}
}
var st = window.setInterval(sw, 1);
}