因为跨域,需要用到iframe嵌套页面,所以采用以下方式,但是右边垂直下拉框可以无限下拉是什么原因呢?
<!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>
<style type="text/css">
/* 底部浮动 */
#wgcss_dingwei { background-position: top center; position: absolute; width:100%;height:94px; z-index: 10000;}
</style>
</head>
<body>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p><div id="wgcss_dingwei" >
</div>
<script type="text/javascript">
var frame=document.getElementById('wgcss_dingwei');
frame.innerHTML="<iframe src='http://www.baidu.com' width='100%' height='100%'></iframe>";
function piaofu_div(){
var bottompiaofu=document.getElementById("wgcss_dingwei");
bottompiaofu.style.left=(document.documentElement.scrollWidth-bottompiaofu.offsetWidth)/2+"px";
bottompiaofu.style.top=(document.documentElement.scrollTop+document.body.scrollTop+document.documentElement.clientHeight-bottompiaofu.offsetHeight)+'px';
setTimeout(piaofu_div,1);
}
piaofu_div();</script>
</body>
</html>
<!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>
<style type="text/css">
/* 底部浮动 */
#wgcss_dingwei { background-position: top center; position: absolute; width:100%;height:94px; z-index: 10000;}
</style>
</head>
<body>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p><div id="wgcss_dingwei" >
</div>
<script type="text/javascript">
var frame=document.getElementById('wgcss_dingwei');
frame.innerHTML="<iframe src='http://www.baidu.com' width='100%' height='100%'></iframe>";
function piaofu_div(){
var bottompiaofu=document.getElementById("wgcss_dingwei");
bottompiaofu.style.left=(document.documentElement.scrollWidth-bottompiaofu.offsetWidth)/2+"px";
bottompiaofu.style.top=(document.documentElement.scrollTop+document.body.scrollTop+document.documentElement.clientHeight-bottompiaofu.offsetHeight)+'px';
setTimeout(piaofu_div,1);
}
piaofu_div();</script>
</body>
</html>
bottompiaofu.style.top=(document.documentElement.scrollTop+document.body.scrollTop+document.documentElement.clientHeight-bottompiaofu.offsetHeight)+'px';
这句话前边应该加个if条件判断下,不知道怎么加。
啊 ie 里面没事 ff 里面可以无限下拉 不清楚你为什么要 加 setTimeout 这段代码 实现漂浮吗 ?
<!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>
<style type="text/css">
/* 底部浮动 */
#wgcss_dingwei { background-position: top center; position: absolute; width:100%;height:94px; z-index: 10000;}
</style>
</head>
<body>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p><div id="wgcss_dingwei" >
</div>
<script type="text/javascript">
var frame=document.getElementById('wgcss_dingwei');
frame.innerHTML="<iframe src='http://www.baidu.com' width='100%' height='100%'></iframe>";
function piaofu_div(){
var bottompiaofu=document.getElementById("wgcss_dingwei");
bottompiaofu.style.left=(document.documentElement.scrollWidth-bottompiaofu.offsetWidth)/2+"px";
bottompiaofu.style.top=(document.documentElement.scrollTop+document.body.scrollTop+document.documentElement.clientHeight-bottompiaofu.offsetHeight)-4+'px';
setTimeout(piaofu_div,1);
}
piaofu_div();</script>
</body>
</html>
可能是高度有点不准确, 进去了 死循环 .. 这样 就行了
http://blog.csdn.net/xkyle/article/details/2454504
<!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>
<style type="text/css">
/* 底部浮动 */
#wgcss_dingwei { background-position: top center; position: fixed ; width:100%;height:94px; z-index: 10000; left:0px;bottom:0px;}
</style>
</head>
<body>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p>
<p>页面询问漂浮代码</p><div id="wgcss_dingwei" >
</div>
<script type="text/javascript">
var frame=document.getElementById('wgcss_dingwei');
frame.innerHTML="<iframe src='http://www.baidu.com' width='100%' height='100%'></iframe>";
</script>
</body>
</html>