網(wǎng)站制作技術(shù)_第1頁
網(wǎng)站制作技術(shù)_第2頁
網(wǎng)站制作技術(shù)_第3頁
已閱讀5頁,還剩4頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、將徹底屏蔽鼠標(biāo)右鍵可用于 table網(wǎng)站制作技術(shù) - 精華代碼(一)1.oncontextmenu="window.event.returnvalue=false" <tableborderoncontextmenu=return(false)><td>no</table>2.<bodyonselectstart="returnfalse"> 取消選取、防止復(fù)制3.onpaste="returnfalse" 不準(zhǔn)粘貼4.oncopy="returnfalse;"onc

2、ut="returnfalse;"防止復(fù)制5.<linkrel="shortcuticon"href="favicon.ico">ie地址欄前換成自己的圖標(biāo)6.<linkrel="bookmark"href="favicon.ico">可以在收藏夾中顯示出你的圖標(biāo)7. <inputstyle="ime-mode:disabled"> 關(guān)閉輸入法8. 永遠(yuǎn)都會(huì)帶著框架<scriptlanguage="javascript&qu

3、ot;><!- if(window=top)top.location.href="frames.htm"/frames.htm 為框架網(wǎng)頁 /-></script>9. 防止被人 frame<scriptlanguage=javascript><!- if(top.location!=self.location)top.location=self.location;/-></script>10. <noscript><iframesrc=*.html></iframe>&l

4、t;/noscript> 網(wǎng)頁將不能被另存為11. <inputtype=buttonvalue= 查看網(wǎng)頁源代碼 onclick="window.location=view-source:+<img src="pic/url.gif" align=absmiddle border=0>12. 怎樣通過 asp 的手段來檢查來訪者是否用了代理 <%ifrequest.servervariables("http_x_forwarded_for")<>""then response.wr

5、ite"<fontcolor=#ff0000> 您通過了代理服務(wù)器, "&_" 真實(shí)的 ip 為 "&request.servervariables("http_x_forwarded_for") endif%>13. 取得控件的絕對(duì)位置/javascript<scriptlanguage="javascript"> functiongetie(e) vart=e.offsettop; varl=e.offsetleft;while(e=e.offsetparent)t

6、+=e.offsettop; l+=e.offsetleft;alert("top="+t+"nleft="+l);</script>/vbscript<scriptlanguage="vbscript"><!- functiongetie() dimt,l,a,b得到控件的位置seta=document.all.img1 t=document.all.img1.offsettop l=document.all.img1.offsetleft whilea.tagname<>"bod

7、y" seta=a.offsetparent t=t+a.offsettop l=l+a.offsetleft wend msgbox"top="&t&chr(13)&"left="&l,64,"endfunction -></script>14. 光標(biāo)是停在文本框文字的最后<scriptlanguage="javascript">functioncc() vare=event.srcelement;varr=e.createtextrange();r.

8、movestart(character,e.value.length);r.collapse(true);r.select();</script><inputtype=textname=text1value="123"onfocus="cc()">15. 判斷上一頁的來源asp:request.servervariables("http_referer")javascript:document.referrer網(wǎng)站制作技術(shù) - 精華代碼(三)28. 檢測(cè)某個(gè)網(wǎng)站的鏈接速度:把如下代碼加入 <body>

9、; 區(qū)域中 :<scriptlanguage=javascript>tim=1setinterval("tim+",100)b=1varautourl=newarray()autourl1="< src="pic/url.gif" align=absmiddle border=0>autourl2=""autourl3="< src="pic/url.gif" align=absmiddle border=0> autourl4=""aut

10、ourl5="< src="pic/url.gif" align=absmiddle border=0> functionbutt()document.write("<formname=autof>")for(vari=1;i<autourl.length;i+)document.write("<inputtype=textname=txt"+i+"size=10value= 測(cè)試中 >= <inputtype=textname=url"+i+"s

11、ize=40>= 刷新 ></form>")鏈接超時(shí) "時(shí)間 "+tim/10+" 秒 "<inputtype=buttonvalue=goonclick=window.open(this.form.url"+i+".value)><br/>") document.write("<inputtype=submitvalue=butt()functionauto(url)document.forms0"url"+b.value=url

12、if(tim>200)document.forms0"txt"+b.value="elsedocument.forms0"txt"+b.value=" b+ functionrun()for(vari=1;i<autourl.length;i+)document.write("<imgsrc=http:/"+auto url+"/"+math.random()+"width=1height=1onerror=auto(< src="pic/url.gi

13、f" align=absmiddle border=0>http:/"/;+autourl+")>")run()</script>29. 各種樣式的光標(biāo) auto :標(biāo)準(zhǔn)光標(biāo) default :標(biāo)準(zhǔn)箭頭hand :手形光標(biāo)wait :等待光標(biāo)text : i 形光標(biāo) vertical-text :水平 i 形光標(biāo) no-drop :不可拖動(dòng)光標(biāo) not-allowed :無效光標(biāo) help : ?幫助光標(biāo) all-scroll :三角方向標(biāo) move:移動(dòng)標(biāo) crosshair :十字標(biāo) e-resize n-resize nw-

14、resize w-resize s-resize se-resize sw-resize30. 本地?zé)o緩存,每次自動(dòng)刷新 response.expires=0 response.addheader"pragma","no-cache" response.addheader"cache-control","private"31. 修改 contenttype 并下載 gif 等格式 <% functiondl(f,n) onerrorresumenextsets=createobject("adodb

15、.stream") s.mode=3 s.type=1s.open s.loadfromfile(server.mappath(f) iferr.number>0thenresponse.writeerr.number&":"&err.descriptionelseresponse.contenttype="application/x-gzip"response.addheader"content-disposition:","attachment;filename="&n

16、response.binarywrite(s.read(s.size)endifendfunctioncalldl("012922501.gif","t1.gif")%>32. 檢查一段字符串是否全由數(shù)字組成 <scriptlanguage="javascript"><!- functionchecknum(str)return!/d/.test(str) alert(checknum("1232142141") alert(checknum("123214214a1")

17、/-></script>33. 獲得一個(gè)窗口的大小 document.body.clientwidth,document.body.clientheight document.body.offsetwidth,document.body.offsetheight 有時(shí)還需要知道 window.screentop,window.screenleft34. 怎么判斷是否含有漢字 if(escape(str).indexof("%u")!=-1)alert(" 含有漢字 "); elsealert(" 全是字符 ");35

18、. textarea 自適應(yīng)文字行數(shù)的多少ie5.5+ 可以用 overflow-y:visible <textarearows=1name=s1cols=27style="overflow-y:visible"> </textarea>36. 日期減去天數(shù)等于第二個(gè)日期<scriptlanguage=javascript>functioncc(dd,dadd)/ 可以加上錯(cuò)誤處理 vard=newdate(dd.replace("-","/") d.setdate(d.getdate()+dadd

19、)alert(d.getfullyear()+" 年 "+(d.getmonth()+1)+"月"+d.getdate()+" 日")cc("2002-2-28",2)</script>網(wǎng)站制作技術(shù) - 制作 1px 邊框表格的幾種方法 有過網(wǎng)頁制作經(jīng)驗(yàn)的朋友一定知道:一般來講,把表格的邊框定義為 1px 時(shí),即 border=1 ,而 實(shí)際上是 2px 。而我們?cè)诤芏鄷r(shí)候需要那種真正的邊框?yàn)?1px 的表格,下面就介紹幾種方法。一、用嵌套表格2px,并設(shè)置對(duì)齊屬性為水平居中、垂里層表格背景設(shè)為與網(wǎng)頁背

20、景相同, 這用兩個(gè)表格嵌套,外層的表格的長(zhǎng)與寬比里層的多出直居中, 然后把外層表格的背景設(shè)為你需要的邊框顏色,樣就實(shí)現(xiàn)我們的愿望了,實(shí)例如下:<table cellspacing="0" cellpadding="0" bgcolor="#000000" width="32" height="32" border="0"><tr><td align="center"><table cellspacing="

21、;0" cellpadding="0" bgcolor="#ffffff" width="30" height="30" border="0"><tr><td> </td></tr></td></tr></table>二、設(shè)置亮、暗邊框顏色表格有亮邊框 (bordercolorlight) 和暗邊框 (bordercolordark) 兩個(gè)屬性,把表格邊框(border) 設(shè)為 1px ,亮邊框

22、(bordercolorlight)設(shè)為背景色,暗邊框 (bordercolordark) 設(shè)為你需要的實(shí)際邊框顏色就可以了,實(shí)列如下:<table border="1" cellpadding="0" cellspacing="0" width="32" height="32" bordercolorlight="#000000" bordercolordark="#FFFFFF"><tr><td> </td></tr></table>

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論