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

首頁 > 語言 > JavaScript > 正文

利用js對象彈出一個層

2024-05-06 14:18:19
字體:
來源:轉載
供稿:網友

代碼如下:
<!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> 
<script language="javascript"> 
function cmsgbox(vtitle,vwidth,vhight,vtop,vleft) 

 this.title=vtitle; 
 this.width=vwidth; 
 this.height=vhight; 
 this.top=vtop; 
 this.left=vleft; 
 this.id=0; 

cmsgbox.prototype.showdiv=function() 

 var str=""; 
 str+="<div id='div1' style='z-index:1;background-color:white;position:absolute;border:2px solid slategray;left:"+this.vleft+"px;top:"+this.vtop+"px;width:"+this.width+"px;'>"; 

 str+="<div style='padding-bottom:2px;background-color:slategray;width:100%;height:16px;color:white;' >"; 
 str+=" <div style='float:left;height:16px;overflow:hidden;margin:0px;padding:4px 0px 0px 5px;width:"+(parseInt(this.width)-24*2-5)+"px;'>"+this.title+"</div>"; 
 str+=" <span style='width:14px;font-family:webdings;cursor:hand;'>0</span>"; 
 str+=" <span style='width:14px;font-family:webdings;cursor:hand;'  onclick='cmsgbox.closediv(this);'>r</span>"; 
 str+="</div>"; 

 str+="<div style=' margin:10px 5px 10px 10px;word-break:break-all;'>"; 
 str+="xxx"; 
 str+="</div>"; 
 str+="</div>"; 
 //document.write(str); 
 document.body.insertAdjacentHTML("beforeEnd",str); 

/////////////////////窗口顯示////////////////////////////// 
function show() 

 var box=new cmsgbox('小家伙呀',400,300); 
 box.showdiv(); 

</script> 
</head> 

<style> 
body{ 
 font-size:12px; 

</style> 
<body> 
<p onclick="show();">彈了一個層</p> 
</body> 
</html> 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 通州区| 防城港市| 新沂市| 柞水县| 西乡县| 聂拉木县| 石城县| 东乡县| 龙江县| 延津县| 福安市| 竹北市| 赞皇县| 万宁市| 平阴县| 区。| 兴和县| 遵义县| 宣城市| 万年县| 读书| 祁东县| 寿光市| 交口县| 葵青区| 扬中市| 云安县| 哈巴河县| 淮北市| 六枝特区| 玉树县| 临猗县| 绥芬河市| 招远市| 台州市| 磐安县| 陇川县| 达拉特旗| 宜城市| 泸西县| 丰台区|