求做一个简单的工具条,用 就像facebook或者renren网下面的那一条能一直 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就像facebook或者renren网下面的那一条能一直显示在页面最下方,滚动页面了以后也不会改变位置用javascript写麻烦大家了,我是javascript新人,请过关照 <!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>Fixed</title><style>* { font-size:12px; font-family:Verdana,宋体; }html, body { margin:0px; padding:0px; overflow:hidden; }.b { margin:0px; padding:0px; overflow:auto; }.line0 { line-height:20px; background-color:lightyellow; padding:0px 15px; }.line1 { line-height:18px; background-color:lightblue; padding:0px 10px; }.w { position:absolute; right:10px; bottom:10px; width:160px; height:240px; overflow:hidden; border:2px groove #281; cursor:default; -moz-user-select:none; }.t { line-height:20px; height:20px; width:160px; overflow:hidden; background-color:#27C; color:white; font-weight:bold; border-bottom:1px outset blue; text-align:center; }.winBody { height:218px; width:160px; overflow-x:hidden; overflow-y:auto; border-top:1px inset blue; padding:10px; text-indent:10px; background-color:white; }</style></head><body><div class="w"> <div class="t">Demo Win - Fixed</div> <div class="winBody">Hello world</div></div></body><script>//测试用,随机产生一定的内容for(var i=0; i<400; i++)document.write("<div class=\"line"+(i%2)+"\">"+(new Array(20)).join((Math.random()*1000000).toString(36)+" ")+"<\/div>");//代码如下:new function(w,b,c,d,o){ d=document;b=d.body;o=b.childNodes;c="className"; b.appendChild(w=d.createElement("div"))[c]= "b"; for(var i=0; i<o.length-1; i++)if(o[i][c]!="w")w.appendChild(o[i]),i--; (window.onresize = function(){ w.style.width = d.documentElement.clientWidth + "px"; w.style.height = d.documentElement.clientHeight + "px"; })();}</script></html> 在脚本里再加上: var getE = document.getElementsByTagName('div')[0]; getE.style.left = (document.body.clientWidth- getE.offsetWidth)/2 + "px"; 用脚本对文本框赋值,事件oninput不会触发,这个怎么解决呢 仿51job地区选择 的问题。有点难搞哦~ fullcalendar 日程 实现扩展功能 ExtJs OS 挑战 Chrome OS ? search tip 问题 一个很简单的给分题~~大家帮帮忙~ 在网上看到下面一段代码,不理解该变量是一个类还是什么?望大虾解释一下! 推荐哪里有正则表达式学习网站 用mozilla,firefox浏览器,怎样实现类似IE的showModalDialog功能? 求助一个文件地址的判断的正则表达式!!! 求一段把文字替换为图片的JS代码 window.location.href无法跳转,求助!
能一直显示在页面最下方,滚动页面了以后也不会改变位置用javascript写麻烦大家了,我是javascript新人,请过关照
<!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>Fixed</title>
<style>
* { font-size:12px; font-family:Verdana,宋体; }
html, body { margin:0px; padding:0px; overflow:hidden; }
.b { margin:0px; padding:0px; overflow:auto; }
.line0 { line-height:20px; background-color:lightyellow; padding:0px 15px; }
.line1 { line-height:18px; background-color:lightblue; padding:0px 10px; }
.w { position:absolute; right:10px; bottom:10px; width:160px; height:240px; overflow:hidden; border:2px groove #281; cursor:default; -moz-user-select:none; }
.t { line-height:20px; height:20px; width:160px; overflow:hidden; background-color:#27C; color:white; font-weight:bold; border-bottom:1px outset blue; text-align:center; }
.winBody { height:218px; width:160px; overflow-x:hidden; overflow-y:auto; border-top:1px inset blue; padding:10px; text-indent:10px; background-color:white; }
</style>
</head>
<body>
<div class="w">
<div class="t">Demo Win - Fixed</div>
<div class="winBody">Hello world</div>
</div>
</body>
<script>
//测试用,随机产生一定的内容
for(var i=0; i<400; i++)document.write("<div class=\"line"+(i%2)+"\">"+(new Array(20)).join((Math.random()*1000000).toString(36)+" ")+"<\/div>");
//代码如下:
new function(w,b,c,d,o){
d=document;b=d.body;o=b.childNodes;c="className";
b.appendChild(w=d.createElement("div"))[c]= "b";
for(var i=0; i<o.length-1; i++)if(o[i][c]!="w")w.appendChild(o[i]),i--;
(window.onresize = function(){
w.style.width = d.documentElement.clientWidth + "px";
w.style.height = d.documentElement.clientHeight + "px";
})();
}
</script>
</html>
var getE = document.getElementsByTagName('div')[0];
getE.style.left = (document.body.clientWidth- getE.offsetWidth)/2 + "px";