代码
function toMinBox(obj) {
var speed = 10;
function strechH() {
var h = obj.offsetHeight;
if (h - speed <= 0) {
obj.style.display
= "none";
clearInterval(intervalID_Min);
}
else {
obj.style.height
= (h - speed) + "px";
}
}

intervalID_Min
= setInterval(strechH, 2);
}

function toMaxBox(obj) {
obj.style.display
= "block";
var speed = 10;
var originalHeight = !obj.childNodes[0].offsetHeight ? obj.getElementsByTagName("ul")[0].offsetHeight : obj.childNodes[0].offsetHeight;
function strechM() {
var h = obj.offsetHeight;
if (h >= originalHeight) {
clearInterval(intervalID_Max);
}
else {
obj.style.height
= (h + speed) + "px";
}
}

intervalID_Max
= setInterval(strechM, 2);
}

 

相关文章:

  • 2021-08-23
  • 2021-06-30
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
猜你喜欢
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-11-30
  • 2021-06-06
  • 2022-12-23
相关资源
相似解决方案