bbs.csdn.net 打开页面的时候,浏览器右下方会浮出一个广告宣传框。 点击关闭后就关掉 请问是怎么做的? 谢谢了。。
解决方案 »
- js闭包
- 页面跳转问题
- 有关event.srcElement的一点疑问
- 下拉列控制多个文本框显示与隐藏
- 各位朋友们快了帮帮忙啊!很急!我用JS 解析XML文件,读取时候没问题!但当我在没有关页面的情况下!为XML添加了一个节点后,JS解析的居然还是
- 如何判断字符串是由字母和数字同时组成的
- 急,我是新手
- 如何引用里面的表格 ???<table id="outerTable"><tr>,<td><table id="innerTable"></table></td></tr></table>
- 急问!
- Jquery validate验证结果validator.form()问题
- 现在论坛怎么都是些jquery和ext了?
- 在Jquery中给母板页中的控件赋值
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD> <BODY>
<input type="button" value="pop" onclick="floatDiv.show('test')"/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<div id="test" style="width:300px;height:200px;display:none;position:absolute;background:#c0c0c0;">sdfasdfasdfasdf<input onclick="floatDiv.hide()" type="button" value="hide"/></div>
</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
var floatDiv = function(){
var d = document,dd = d.documentElement,db = d.body,fd,sd,sdh, timer,timer2,time,step,mr = Math.round,isStrict = d.compatMode == "CSS1Compat";
return {
show:function(id){
time = 10;
if(!fd){
fd = d.body.appendChild(d.createElement('div'));
sd = d.getElementById(id);
fd.appendChild(sd);
sd.style.cssText += ';display:block;position:absolute;left:0;';
sdh = sd.offsetHeight;
fd.style.cssText = "overflow:hidden;position:absolute;bottom:0;right:0;width:"+sd.offsetWidth+"px;height:"+sdh+"px;";
}
fd.style.display = 'block';
sd.style.bottom = "-"+sdh+'px';
step = sdh/55;
timer = setInterval(function(){
if(time<0){
clearInterval(timer)
}else{
sd.style.bottom = parseInt(sd.style.bottom) + mr(time*step)+'px'
time -=1;
}
},10)
function scroll(){
var st = isStrict?dd.scrollTop:db.scrollTop,c,dbh = isStrict?dd.clientHeight:db.clientHeight,t = 500;
c = st - fd.offsetTop + (dbh-sdh);
c!=0&&(fd.style.top = fd.offsetTop + Math.ceil(c/10) + 'px',t=10);
timer2 = setTimeout(scroll,t)
};
scroll();
},
hide:function(){
time = 10;
clearTimeout(timer2);
timer = setInterval(function(){
if(time<0){
clearInterval(timer);
fd.style.display = 'none';
}else{
sd.style.bottom = parseInt(sd.style.bottom) - mr(time*step)+'px'
time -=1;
}
},10)
}
}
}()
</SCRIPT>