JavaScript: jquery框架的滑出滑入的动画效果是怎么实现的?

来源:百度知道 编辑:UC知道 时间:2024/09/23 02:29:44
用JavaScript怎么写?如果你;懒得写,说说大概的思路也行.

clientHeight

然后递归,直到这个高度为0,或者直到这个高度为一个指定的高度

function showBox()
{
if (sb != null){
clearTimeout(sb);
}
if (cb != null) {
clearTimeout(cb);
}
var o = $('rbbox');
o.style.display = 'block';
var H = parseInt(o.style.height)
o.style.height = (o.clientHeight + Math.ceil((55 - o.clientHeight) * 0.035)) + "px";
if (o.clientHeight < 55) {
sb = setTimeout(function(){showBox()}, 2);
}
else {
cb = setTimeout(function(){closeBox()}, 3800);
return;
}
}

function closeBox(msg)
{
if (cb != null) {
clearTimeout(cb);
}
var o = $('rbbox');
var dy = Math.ceil((parseInt(o.style.height) - 4) * 0.875).toString();
o.style.height = dy + "px";
if(o.clientHeight <= 5){
document.getElementById("rbbox").style.display = 'none';
return;<