国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

javascript實現的固定位置懸浮窗口實例

2019-11-20 12:35:06
字體:
來源:轉載
供稿:網友

本文實例講述了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>//m.survivalescaperooms.com/</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>

希望本文所述對大家的javascript程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南昌市| 西藏| 邵武市| 安远县| 乌鲁木齐市| 永胜县| 高阳县| 攀枝花市| 新兴县| 交口县| 文安县| 巍山| 方正县| 铜鼓县| 乐陵市| 南岸区| 遵义市| 临邑县| 宁夏| 饶河县| 中江县| 银川市| 德庆县| 瑞金市| 满洲里市| 渭南市| 弋阳县| 丹棱县| 日喀则市| 芦溪县| 县级市| 望谟县| 汉中市| 泸定县| 剑川县| 宜宾市| 乌兰察布市| 昂仁县| 桐城市| 南雄市| 德江县|