浮动层 想制作一个浮动层,像http://www.opple-lighting.com/右下角那个send message.固定在浏览器右下角. 该怎么实现呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 浮动广告?使用div.style和document.body来精确定位 <html> <script> var imgPanel = document.createElement("img"); imgPanel.src = "http://www.cnblogs.com/images/logo_small.gif"; function FloatDiv(youPanel) { this.container = document.createElement("div"); this.container.appendChild(youPanel); this.innerPanel = youPanel; this.container.style.position = "fixed";//这个属性会保持你这个container的决定位置 this.container.style.right = "0px";//设置靠右边 //this.container.style.top = "100px";//设置Y轴位置 this.container.style.bottom = "10px";//设置Y轴位置 document.body.appendChild(this.container); } function doSomething() { //首先添加一些占空间的div for(var i = 0; i < 100; i++) { var split = document.createElement("div"); split.innerHTML = "the " + i +" line"; document.body.appendChild(split); } //新建一个浮动div,把你想要放进去的东西给塞进去就好了 new FloatDiv(imgPanel); } </script> <body onload="doSomething()"> </body></html> 请问一个jQuery的问题,谢谢 js 脚本的运行顺序 用JavaScript导出为Word文档分页问题 function? 框架页面定向的问题。 求!返回当天所在的周是一年中第几周的函数或方法! AJAX资料收集 查询静止浮层代码 提问!我要屏蔽";"怎么做?? 如何捕获ActiveX控件的事件?(续) 高手进 js访问webserivce xml解析问题(不会的捧人场刷每天分) validate 验证失效问题,在线等...................................
<script>
var imgPanel = document.createElement("img");
imgPanel.src = "http://www.cnblogs.com/images/logo_small.gif"; function FloatDiv(youPanel)
{
this.container = document.createElement("div");
this.container.appendChild(youPanel);
this.innerPanel = youPanel;
this.container.style.position = "fixed";//这个属性会保持你这个container的决定位置
this.container.style.right = "0px";//设置靠右边
//this.container.style.top = "100px";//设置Y轴位置
this.container.style.bottom = "10px";//设置Y轴位置
document.body.appendChild(this.container);
} function doSomething()
{
//首先添加一些占空间的div
for(var i = 0; i < 100; i++)
{
var split = document.createElement("div");
split.innerHTML = "the " + i +" line";
document.body.appendChild(split);
} //新建一个浮动div,把你想要放进去的东西给塞进去就好了
new FloatDiv(imgPanel);
}
</script>
<body onload="doSomething()">
</body>
</html>