<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><style>
body{
height:2000px;
width:2000px;
}
#a{
width:300px;
height:100px;
background:red;
}
</style>
<script>
window.onload = function(){
var a = document.getElementById('a');
a.style.position = 'absolute';
a.style.right = '0';
a.style.bottom = '0';
window.onscroll = function(){
a.innerHTML = '';
}
}
</script>
<div id='a'></div></body>
</html>用a.innerHTML = '';就能实现随屏移动了
蓝色有人发现的,本人是第一次看到
谁解析一下注意是ie6
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><style>
body{
height:2000px;
width:2000px;
}
#a{
width:300px;
height:100px;
background:red;
}
</style>
<script>
window.onload = function(){
var a = document.getElementById('a');
a.style.position = 'absolute';
a.style.right = '0';
a.style.bottom = '0';
window.onscroll = function(){
a.innerHTML = '';
}
}
</script>
<div id='a'></div></body>
</html>用a.innerHTML = '';就能实现随屏移动了
蓝色有人发现的,本人是第一次看到
谁解析一下注意是ie6
解决方案 »
- 我完蛋了,这种情况该怎么处理?
- 动态radio改为button,radio源码如下
- js获取下拉列表框的长度
- 怎样将一首MP3另存为。
- ★★★★★JS脚本性能优化: 网页Treeview优化探讨(meizz)
- 看看这条语句再说吧.....呵呵
- 大家過來看看嘍
- 请问如何判断某弹出窗口已存在?
- 为什么焦点在text里面的时候,按下Enter的效果就是刷新整个页面,如何去掉这个动作?
- <button onclick='parent.contents.location="c.htm";parent.main.location="d.htm";'>click</button>
- 紧急求助,javascript的dom变量问题?
- 客户端控制TreeView——新手请教()
见怪不怪
前面还见过的有把for循环终止掉.因为有流重写.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body><style>
body{
height:2000px;
width:2000px;
}
#a{
width:300px;
height:100px;
background:red;
}
</style>
<script>
window.onload = function(){
var a = document.getElementById('a');
a.style.position = 'absolute';
a.style.right = '0';
a.style.bottom = '0';
window.onscroll = function(){
//a.innerHTML = '';
document.getElementById("b").innerHTML = "";//设其他的innerHTML效果一样,无语
}
}
</script>
<div id='a'></div>
<div id="b"></div>
</body>
</html>
tr.innerHTML = '<td>some text</td>'会出错。//但是td.innerHTML = "some text" 可以。
<p>.innerHTML="<li>some text</li>"也会出错。
<select>.innerHTML = "<option>some text</option"也会出错。//但是select.outerHTML = "<select>...</select>"可以。
估计是Reflow的问题
但这个也特殊了点
因为
window.onscroll = function(){
a.style.right = '0';
a.style.bottom = '0';
}
就算了是这样显然也做不到出现的效果
但innerHTML却能做到,这才是最奇怪的地方
看了无忧的回帖
你说的应该没错
为什么重绘之后right 和bottom 会对应到当前的视窗了呢
不知有没有牛人研究过这个
对这个挺有兴趣
说不定以后ie6兼容fixed又有新方法