Javascript 最简滑动弹出和隐藏DIV(消息提示)
//隐藏 function hideMessageBar(o,t,i,j,s){ var o = document.getElementById('NtalkerToolbar'); i=j=1;s=o.style; t=setInterval(function(){ o.offsetTop<document.body.clientHeight?(s.top=(o.offsetTop+2)+"px"):clearInterval(t); },15); } //显示 function showMessageBar(o,t,i,j,s){ var o = document.getElementById('NtalkerToolbar'); i=j=1;s=o.style; t=setInterval(function(){ o.offsetTop>(document.body.clientHeight-34)?(s.top=(o.offsetTop-2)+"px"):clearInterval(t); },15); //显示后延迟10秒自动隐藏 setTimeout(hideMessageBar,10000); }