82.event.x,event.clientX,event.offsetX區別: x:設置或者是獲得鼠標相對於目標事件的父元素的外邊界在x座標上的位置。 clientX:相對於客戶區域的x座標位置,不 包括滾動條,就是正文區域。 offsetx:設置或者是獲得鼠標相對於目標事件的父元素的內邊界在x座標上的位置。 screenX:相對於用戶屏幕。 83.顯示是鼠標按鈕的哪一個 <body onMouseDown="alert(event.button)">點Mouse看看// 84.打開C盤 <form action="file:///c|/"><input type="submit" value="c:\ drive"></form>// 85.當前屏幕的分辨率 screen.width、screen.height// 86.設置表格中的內容 tbl.rows[0].cells[1].innerText=document.form.text1.value;// 87.本地快捷鍵 <p><a href="file:///::{208D2C60-3AEA-1069-A2D7-08002B30309D}" target="_blank">網上鄰居</a></p> <p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\d:\web" target="_blank">個人電腦</a></p> <p><a href="file:///::{450D8FBA-AD25-11D0-98A8-0800361B1103}" target="_blank">個人文檔</a></p> <p><a href="file:///::{645FF040-5081-101B-9F08-00AA002F954E}" target="_blank">回收站</a></p> <p><a href="file:///::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}" target="_blank">控制面板</a></p> <p><a href="file:///::{7007ACC7-3202-11D1-AAD2-00805FC1270E}">撥號網絡</a>(windows 2000)</p> 88.IE菜單 <button onclick="min.Click()"><font face="webdings">0</font></button>//改變按鈕上的圖片 <input type=button onclick="document.execCommand('CreateLink','true','true')"> //建立新鏈接 <input type=button onclick="document.execCommand('print','true','true')"> //打印 <input type=button onclick="document.execCommand('saveas','true','網站製做.htm')">//另存爲htm <input type=button onclick="document.execCommand('saveas','true','網站製做.txt')">//另存爲txt document.execCommand("SaveAs")//保存爲 document.execCommand('undo')//撤銷上一次操做 89.web對話框 <SCRIPT> var contents='<style>body,td{font:menu}img{cursor:hand}</style>'; contents+='<title>你要關閉我嗎</title>'; contents+='<body bgcolor=menu>'; contents+='<table width=100% height=100% border=0>'; contents+='<tr><td align=center>'; contents+='你要關閉我嗎?<br>'; contents+='<img src=dark.gif onclick=self.close() alt="...關閉">'; contents+='<img src=jet.gif onclick=self.close() alt="全是關閉">'; contents+='</td></tr></table>'; showModalDialog("about:"+contents+"","","dialogHeight:50px;dialogWidth:250px;help:no;status:no") document.write(contents); </SCRIPT>// 90.取第x,y的值 <button onclick="t1.rows[x].cells[y].innerText='guoguo'"></button>// 91.向新打開的網頁上寫內容 newwin=window.open('about:blank','','top=10'); newwin.document.write('');// 93.返回 javascript:history.go(-2);// 94.將頁面上選中的內容複製到剪貼板 abcdefg <input type='button' onclick="window.clipboardData.setData('text',document.selection.createRange().text);" value='複製頁面選中 的字符'>// 95.將頁面上選中的內容複製到剪貼板 <INPUT TYPE="text" NAME="">kjhkjhkhkj<INPUT TYPE="button" onclick="document.execCommand('Copy', 'false', null);">//// 96.鼠標移到下拉框時自動所有打開 <select onmouseover="javascript:this.size=this.length" onmouseout="javascript:this.size=1"></select>// 97.得到本機的文件 var fso = new ActiveXObject("Scripting.FileSystemObject"); var f1 = fso.GetFile("C:\\bsitcdata\\ejbhome.xml"); alert("File last modified: " + f1.DateLastModified); // 98.判斷客戶端是不是IE瀏覽器 由於 document.all 是 IE 的特有屬性,因此一般用這個方法來判斷客戶端是不是IE瀏覽器 ,document.all?1:0; 99.建立新的下拉框選項 new Option(text,value)這樣的函數// 100.在頁面上畫柱狀圖 <STYLE> td{font-size:12px} body{font-size:12px} v\:*{behavior:url(#default#VML);} //這裏聲明瞭v做爲VML公用變量 </STYLE> <SCRIPT LANGUAGE="JavaScript"> mathstr=12; document.write ("<v:rect fillcolor='red' style='width:20;color:navy;height:"+5000/(1000/mathstr)+"'><br> %"+mathstr+"<br>4人<v:Extrusion backdepth='15pt' on='true'/></v:rect>") </SCRIPT> <v:rect fillcolor='red' style='width:20;color:navy;height:200'><br>%12<br>4人<v:Extrusion backdepth='15pt' on='true'/></v:rect> <v:rect fillcolor='yellow' style='width:20;color:navy;height:100'><br>%12<br>4人<v:Extrusion backdepth='15pt' on='true'/></v:rect>// 101.餅圖 <style> v\:* { behavior: url(#default#VML) } o\:* { behavior: url(#default#VML) } .shape { behavior: url(#default#VML) } </style> <script language="javascript"> function show(pie) { pie.strokecolor=pie.fillcolor; pie.strokeweight=10; div1.innerHTML="<font size=2 color=red> " + pie.id +"</font> <font size=2>" + pie.title + "</font>"; } function hide(pie) { pie.strokecolor="white"; pie.strokeweight=1; div1.innerHTML=""; } </script> </head> <body> <v:group style='width: 5cm; height: 5cm' coordorigin='0,0' coordsize='250,250'> <v:shape id='asp技術' style='width:10;height:10;top:10;left:0' title='得票數:6 比例:40.00%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#ffff33'><v:path v='m 300,200 ae 300,200,200,150,0,9437184 xe'/></v:shape> <v:shape id='php' style='width:10;height:10;top:10;left:0' title='得票數:1 比例:6.67%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#ff9933'><v:path v='m 300,200 ae 300,200,200,150,9437184,1572864 xe'/></v:shape> <v:shape id='jsp' style='width:10;height:10;top:10;left:0' title='得票數:2 比例:13.33%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#3399ff'><v:path v='m 300,200 ae 300,200,200,150,11010048,3145728 xe'/></v:shape> <v:shape id='c#寫的.netWEB程序' style='width:10;height:10;top:10;left:0' title='得票數:3 比例:20.00%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#99ff33'><v:path v='m 300,200 ae 300,200,200,150,14155776,4718592 xe'/></v:shape> <v:shape id='vb.net寫的.netWEB程序' style='width:10;height:10;top:10;left:0' title='得票數:2 比例:13.33%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#ff6600'><v:path v='m 300,200 ae 300,200,200,150,18874368,3145728 xe'/></v:shape> <v:shape id='xml技術' style='width:10;height:10;top:10;left:0' title='得票數:1 比例:6.67%' onmouseover='javascript:show(this);' onmouseout='javascript:hide(this);' href='http://www.cnADO.com' CoordSize='10,10' strokecolor='white' fillcolor='#ff99ff'><v:path v='m 300,200 ae 300,200,200,150,22020096,1572864 xe'/></v:shape> </v:group> <v:group style='width: 6cm; height: 6cm' coordorigin='0,0' coordsize='250,250'> <v:rect style='height:10;width:15;top:0;left:10' fillcolor='#ffff33'/> <v:rect style='height:28;width:100;top:0;left:30' stroked='false'><v:textbox style='fontsize:2'>asp技術</v:textbox/></v:rect> <v:rect style='height:10;width:15;top:30;left:10' fillcolor='#ff9933'/> <v:rect style='height:28;width:100;top:30;left:30' stroked='false'><v:textbox style='fontsize:2'>php</v:textbox/></v:rect> <v:rect style='height:10;width:15;top:60;left:10' fillcolor='#3399ff'/> <v:rect style='height:28;width:100;top:60;left:30' stroked='false'><v:textbox style='fontsize:2'>jsp</v:textbox/></v:rect> <v:rect style='height:10;width:15;top:90;left:10' fillcolor='#99ff33'/> <v:rect style='height:28;width:100;top:90;left:30' stroked='false'><v:textbox style='fontsize:2'>c#寫的.netWEB程序</v:textbox/></v:rect> <v:rect style='height:10;width:15;top:120;left:10' fillcolor='#ff6600'/> <v:rect style='height:28;width:100;top:120;left:30' stroked='false'><v:textbox style='fontsize:2'>vb.net 寫的.netWEB程序</v:textbox/></v:rect> <v:rect style='height:10;width:15;top:150;left:10' fillcolor='#ff99ff'/> <v:rect style='height:28;width:100;top:150;left:30' stroked='false'><v:textbox style='fontsize:2'>xml技術 </v:textbox/></v:rect> </v:group> <div style="position: absolute; left: 10; top: 10; width: 760; height:16"> <table border="1" cellpadding="2" cellspacing="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#CCCCCC" width="100%" ID="Table1"> <tr> <td width="100%" id=div1> </td> </tr> </table> </div>// 102.是一個特殊的容器,想裝個網頁都行 <button><iframe src="http://www.google.com/"></iframe></button>//button 103.外部的html代碼 event.srcElement.outerHTML// 104.標識當前的IE事件的觸發器 event.srcElement和event.keyCode// 105.事件類型 event.type//