41.細線分隔線
<hr noshade size=0 color=#C0C0C0>
42.過度方式
< http-equiv="Page-Exit" content="revealTrans(Duration=3,Transition=5)">
Duration的值為網頁動態過渡的時間,單位為秒。
Transition是過渡方式,它的值為0到23,分別對應24種過渡方式。如下表:
0 盒狀收縮 1 盒狀放射
2 圓形收縮 3 圓形放射
4 由下往上 5 由上往下
6 從左至右 7 從右至左
8 垂直百葉窗 9 水平百葉窗
10 水平格狀百葉窗 11垂直格狀百葉窗
12 隨意溶解 13從左右兩端向中間展開
14從中間向左右兩端展開 15從上下兩端向中間展開
16從中間向上下兩端展開 17 從右上角向左下角展開
18 從右下角向左上角展開 19 從左上角向右下角展開
20 從左下角向右上角展開 21 水平線狀展開
22 垂直線狀展開 23 隨機產生一種過渡方式
43.如何控制橫向和縱向滾動條的顯隱?
<body style="overflow-y:hidden"> 去掉x軸
<body style="overflow-x:hidden"> 去掉y軸
<body scroll="no">不顯
44.怎樣在 FrontPage2000 中加入 Flash 動畫?
在 FrontPage2000 中,點擊[插入]->[高級]->[插件],在彈出的窗口中,設置一下 Flash 文件的大小及其它信息,確定即可。
45.加入注釋的格式是:
〈!-[注釋內容…]--〉
46.怎樣在網頁中加入 E-mail 鏈接并顯示預定的主題?
〈A href="mailto:itren@itren.cn?subject=主題"〉……〈/a〉
47.定義本網頁關鍵字,
可以在〈Head〉〈/Head〉中加入如下代碼:
〈 name="Keywords" content="E代時光"〉
Content 中所包含的就是關鍵字,你可以自行設置。
這里有個技巧,你可以重復某一個單詞,這樣可以提高自己網站的排行位置,如:
〈 name="Keywords" content="E代時光"〉
48.IE5.0 的部分快捷鍵:
A:打開查找功能:Ctrl+F
關閉瀏覽器窗口:Ctrl+W
打開地址欄下拉列表框:F4
刷 新:F5
將當前Web頁保存到收藏夾列表:Ctrl+D
打開當前 IE 窗口的一個拷貝:Ctrl+N
停止下載當前網頁:Esc
光標迅速移動到網頁的開頭:Home
光標迅速移動到網頁的尾部:End
打開新的地址鍵入窗口:Ctrl+O
打開收藏夾:Ctrl+I
打開歷史記錄文件夾:Ctrl+H
打開瀏覽器設定的默認主頁:Alt+HOME
49.添加到收藏夾:
〈a href="java :external.addFavorite(http://www.itren.cn ,www.itren.cn);"〉添加到收藏夾〈/a〉
50.設為首頁:
〈a href=# =this.style.behavior=url(#default#homepage);this.setHomePage(http://www.itren.cn); 〉設為首頁〈/a〉
51.定制瀏覽器地址欄前的小圖標:
A:在網頁的〈head〉〈/head〉間加入以下語句:
〈link rel="shortcuticon" href="http://…/icon.ico"〉
即可。其中 icon.ico 為 16x16 的圖標文件,顏色不要超過 16 色。
52.把滾動條放在瀏覽器窗口的左邊
A:在 <body> 中加 dir=RTL,即 <body dir=RTL>
53.頁面全部保護
<>
<!--
//加入頁面保護
rf()
{return false; }
oncontextmenu = rf
keydown()
{if(event.ctrlKey ==true || event.keyCode ==93 || event.shiftKey ==true){return false;} }
down =keydown
drag()
{return false;}
ondragstart=drag
stopmouse(e) {
if (navigator.appName == Netscape && (e.which == 3 || e.which == 2))
return false;
else if
(navigator.appName == Microsoft Internet Explorer && (event.button == 2 || event.button == 3)) {
alert("IT人帶給你的是最好的東西");
return false;
}
return true;
}
down=stopmouse;
if (layers)
captureEvents(Event.MOUSEDOWN);
down=stopmouse;
//-->
</>
54.狀態欄的特效,可以很好的屏蔽顯示的地址
< language=java>kstatus();
e3i5(){
self.status="※※歡迎來到【IT人】※※★☆趕快把http://www.itren.cn 告訴給你的朋友吧★☆※※";
setTimeout("e3i5()",0);
}</>
55.防刷新代碼
<%
Dim URL
If DateDiff("s",Request.s("oesun")("vitistime"),Now())<2 Then
URL=Request.ServerVariables("Http_REFERER")
Response.Write("< http-equiv=""refresh"" content=""2;URL="&URL&""">")
Response.Write("防刷新,兩秒后自動跳轉...")
Response.End
End IF
Response.s("oesun")("vitistime")=Now()
%>
56. oncontextmenu="event.return=false" 將徹底屏蔽鼠標右鍵
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
57. <body onselectstart="return false"> 取消選取、防止復制
58. onpaste="return false" 不準粘貼
59. oncopy="return false;" oncut="return false;" 防止復制
60. <link rel="Shortcut Icon" href="favicon.ico"> IE地址欄前換成自己的圖標
61. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夾中顯示出你的圖標
62. <input style="ime-mode:disabled"> 關閉輸入法
63. 永遠都會帶著框架
< language="Java"><!--
if (window == top)top.location.href = "s.htm"; //s.htm為框架網頁
// --></>
64. 防止被人
< LANGUAGE=JAVA><!--
if (top.location != self.location)top.location=self.location;
// --></>
65. 網頁將不能被另存為
<no><i src="/*.html>";</i></no>
66. <input type=button =查看網頁源代碼
="location = view-source:+
67.刪除時確認
<a href="/java" :if(confirm("確實要刪除嗎?"))location="boos.asp?&areyou=刪除&page=1">刪
除</a>
68. 取得控件的絕對位置
//Java
< language="Java">
getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
alert("top="+t+"/nleft="+l);
}
</>
//VB
< language="VB"><!--
getIE()
dim t,l,a,b
set a=all.img1
t=all.img1.offsetTop
l=all.img1.offsetLeft
while a.tagName<>"BODY"
set a = a.offsetParent
t=t+a.offsetTop
l=l+a.offsetLeft
wend
msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"
end
--></>
69. 光標是停在文本框文字的最后
< language="java">
cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart(character,e..length);
r.collapse(true);
r.select();
}
</>
<input type=text name=text1 ="123" ="cc()">
70. 判斷上一頁的來源
java :
referrer
71. 最小化、最大化、關閉窗口
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" ="Minimize"></object>
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" ="Maximize"></object>
<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM NAME="Command" ="Close"></OBJECT>
<input type=button =最小化 =hh1.Click()>
<input type=button =最大化 =hh2.Click()>
<input type=button =關閉 =hh3.Click()>
本例適用于IE
72.屏蔽功能鍵Shift,Alt,Ctrl
<>
look(){
if(event.shiftKey)
alert("禁止按Shift鍵!"); //可以換成ALT CTRL
}
down=look;
</>
73. 網頁不會被緩存
< HTTP-EQUIV="pragma" CONTENT="no-cache">
< HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
< HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
或者< HTTP-EQUIV="expires" CONTENT="0">
74.怎樣讓表單沒有凹凸感?
<input type=text style="border:1 solid #000000">
或
<input type=text style="border-left:none; border-right:none; border-top:none; border-bottom:
1 solid #000000"></textarea>
75.<div><span>&<layer>的區別?
<div>(division)用來定義大段的頁面元素,會產生轉行
<span>用來定義同一行內的元素,跟<div>的唯一區別是不產生轉行
<layer>是ns的標記,ie不支持,相當于<div>
76.讓彈出窗口總是在最上面:
<body ="this.focus();">
77.不要滾動條?
讓豎條沒有:
<body style=overflow:scroll;overflow-y:hidden>
</body>
讓橫條沒有:
<body style=overflow:scroll;overflow-x:hidden>
</body>
兩個都去掉?更簡單了
<body scroll="no">
</body>
78.怎樣去掉圖片鏈接點擊后,圖片周圍的虛線?
<a href="#" ="this.blur()"><img src="/logo.jpg" border=0></a>
79.電子郵件處理提交表單
<form name="form1" method="post" action="mailto:****@***.com" enctype="text/plain">
<input type=submit>
</form>
80.在打開的子窗口刷新父窗口的代碼里如何寫?
opener.location.reload()
81.如何設定打開頁面的大小
<body ="top.resizeTo(300,200);">
打開頁面的位置<body ="top.moveBy(300,200);">
82.在頁面中如何加入不是滿鋪的背景圖片,拉動頁面時背景圖不動
<STYLE>
body
{background-image:url(/logo.gif); background-repeat:no-repeat;
background-position:center;background-attachment: fixed}
</STYLE>
83. 檢查一段字符串是否全由數字組成
< language="Java"><!--
checkNum(str){return str.match(//D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// --></>
84. 獲得一個窗口的大小
body.clientWidth; body.clientHeight
85. 怎么判斷是否是字符
if (/[^/x00-/xff]/g.test(s)) alert("含有漢字");
else alert("全是字符");
86.TEXTAREA自適應文字行數的多少
<textarea rows=1 name=s1 cols=27 onpropertychange="this.style.posHeight=this.scrollHeight">
</textarea>
87. 日期減去天數等于第二個日期
< language=Java>
cc(dd,dadd)
{
//可以加上錯誤處理
var a = new Date(dd)
a = a.Of()
a = a - dadd * 24 * 60 * 60 * 1000
a = new Date(a)
alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日")
}
cc("12/23/2002",2)
</>
88. 選擇了哪一個Radio
<HTML>< language="vb">
checkme()
for each ob in radio1
if ob.checked then alert ob.
next
end
</><BODY>
<INPUT name="radio1" type="radio" ="style" checked>Style
<INPUT name="radio1" type="radio" ="barcode">Barcode
<INPUT type="button" ="check" ="checkme()">
</BODY></HTML>
89.腳本永不出錯
< LANGUAGE="Java">
<!-- Hide
killErrors() {
return true;
}
= killErrors;
// -->
</>
90.ENTER鍵可以讓光標移到下一個輸入框
<input down="if(event.keyCode==13)event.keyCode=9">
91. 檢測某個網站的鏈接速度:
把如下代碼加入<body>區域中:
< language=Java>
tim=1
setInterval("tim++",100)
b=1
var autourl=new Array()
autourl[1]=www.itren.cn
autourl[2]="
autourl[3]="
autourl[4]=www.ebb365.com
autourl[5]="
butt(){
write("<form name=autof>")
for(var i=1;i<autourl.length;i++)
write("<input type=text name=txt"+i+" size=10 =測試中……> =》<input type=text
name=url"+i+" size=40> =》<input type=button =GO
=open(this.form.url"+i+".)><br>")
write("<input type=submit =刷新></form>")
}
butt()
auto(url){
forms[0]["url"+b].=url
if(tim>200)
{forms[0]["txt"+b].="鏈接超時"}
else
{forms[0]["txt"+b].="時間"+tim/10+"秒"}
b++
}
run(){for(var i=1;i<autourl.length;i++)write("<img
src=http://"+autourl+"/"+Math.random()+" width=1 height=1
=auto(http://"+autourl+")>") }
run()</>
92. 各種樣式的光標
auto :標準光標 default :標準箭頭 hand :手形光標 wait :等待光標 text :I形光標 vertical-text :水平I形光標 no-drop :不可拖動光標 not-allowed :無效光標 help :?幫助光標 all-scroll :三角方向標 move :移動標 crosshair :十字標 e-resize n-resize nw-resize w-resize s-resize se-resize sw-resize
93.頁面進入和退出的特效
進入頁面< http-equiv="Page-Enter" content="revealTrans(duration=x, transition=y)">
推出頁面< http-equiv="Page-Exit" content="revealTrans(duration=x, transition=y)">
這個是頁面被載入和調出時的一些特效。duration表示特效的持續時間,以秒為單位。transition表示使用哪種特效,取值為1-23:
0 矩形縮小 1 矩形擴大 2 圓形縮小 3 圓形擴大 4 下到上刷新 5 上到下刷新 6 左到右刷新 7 右到左刷新 8 豎百葉窗 9 橫百葉窗 10 錯位橫百葉窗 11 錯位豎百葉窗 12 點擴散 13 左右到中間刷新 14 中間到左右刷新 15 中間到上下 16 上下到中間 17 右下到左上 18 右上到左下 19 左上到右下 20 左下到右上 21 橫條 22 豎條 23 以上22種隨機選擇一種
94.在規定時間內跳轉
< http-equiv=V="REFRESH" content="5;URL=http://www.51js.com">
95.網頁是否被檢索
< name="ROBOTS" content="屬性值">
其中屬性值有以下一些:
屬性值為"all": 文件將被檢索,且頁上鏈接可被查詢;
屬性值為"none": 文件不被檢索,而且不查詢頁上的鏈接;
屬性值為"index": 文件將被檢索;
屬性值為"follow": 查詢頁上的鏈接;
屬性值為"noindex": 文件不檢索,但可被查詢鏈接;
屬性值為"nofollow": 文件不被檢索,但可查詢頁上的鏈接。
96.flash播放器代碼:
< language="Java" src="http://w2.k688.com/flashmtv/free/1 ... </>(嵌入式)
< language="Java" src="http://w2.k688.com/flashmtv/free/2 ... </>(彈出式)
< language="Java" src="http://w2.k688.com/flashmtv/free/3 ... </>(按鈕式)
97.多郵箱登陸代碼:
<TABLE width="760" height="1" style=font-size:9pt;TEXT-DECORATION:none; border=0 align=center cellPadding=0 cellSpacing=0 bordercolor="#111111" >
<FORM name=mailForm onsubmit="return check(this)" method=post>
<TBODY><TR> <TD width="78%" height=26 align=left bgcolor="#3DB836">
<div align="center"><STRONG><a href=" ... 00CCtarget="_blank"> 郵箱快速登陸→</a></STRONG> <font style=font-size:9pt;>帳號</font>
< language=j.encode src=">
<input style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid" ="this.=;" size=16 =用戶名 name=name>
<font style=font-size:9pt;>信箱:</font>
<select tabindex=2 size=1 name=mailSelect>
<option selected>請選擇您的郵局</option>
<option =http://mail.sina.com.cn/cgi-bin/login.cgi;u;psw>@sina.com</option>
<option =http://vip.sina.com/cgi-bin/login.cgi;user;pass>@vip.sina.com</option>
<option =http://bjweb.163.net/cgi/163/login_pro.cgi;user;pass>@163.net</option>
<option =http://webmail.21cn.net/nature/gb/NULL/NULL/NULL/SignIn.gen;LoginName;passwd;hidden;DomainName;21cn.net>@21cn.net</option>
<option =http://freemail.263.net/cgi/login;user;pass>@263.net</option>
<option =http://vip.163.com/payment/VipLogon.jsp;username;password;post>@vip.163.com</option>
<option =http://web.netease.com/cgi/login;user;pass;post>@netease.com</option>
<option =http://web.yeah.net/cgi/login;user;pass;post>@Yeah.net</option>
<option =http://freemail.china.com/extend/gb/NULL/NULL/NULL/SignIn.gen;LoginName;passwd;post>@mail.china.com</option>
<option =http://login.mail.sohu.com/chkpwd.php;UserName;Password;post>@sohu.com</option>
<option =http://login.chinaren.com/zhs/servlet/Login;username;password;post;hidden;url;http://mail.chinaren.com>@ChinaRen.com</option>
<option =http://edit.bjs.yahoo.com/config/login;login;passwd;post>@yahoo.com.cn</option>
<option =https://login.passport.com/ppsecure/post.srf?da=passport.com&svc=mail;login;passwd;suffix;msn.com>@msn.com</option></select>
<font style=font-size:9pt;>密碼:</font>
<input style="BORDER-RIGHT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 1px solid"
=this.select() tabindex=3ā type=password size=12 name=password>
<input type=submit =登陸 name=Submit2>
< language="Java" type="text/Java" src="http://union.3721.com/ass/txt_2.js?pid2=A_ ... ;></>
<a href=" ... 0"target="_blank">
<font color="#FF0000">免費代碼</font></a> </div></TD></TR></FORM></TABLE>
98.IP來源地顯示代碼:(四種)
1)< src=">
效果:歡迎您來自:福建省福州市 的朋友.您的IP:218.66.37.215【網】
2)< src=">
效果: 您的IP:218.66.37.215
您來自:福建省福州市
3)< src=">
效果:您的IP:218.66.37.215.來自:福建省福州市【網】
4)< src=">
效果:(只顯示IP和地址,前后文字可自己添加)
218.10.89.246 黑龍江省哈爾濱市 【網】 218.10.89.246 黑龍江省哈爾濱市 【網】 219.128.2.25 廣東省中山市 【網】 218.10.89.246 黑龍江省哈爾濱市 【網】 219.128.2.25 廣東省中山市 【網】 218.66.37.215. 福建省福州市【網】
99.百度搜索代碼:
<i id="baidu" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0"
spacing="0" border="0" scrolling="no" width="468" height="50"
src="http://unstat.baidu.com/bdun.bsc?tn=jianliang&csid=101&rkcs=2& ... 000&rk=0&bd=1&bdas=0">
</i>
posted on 2007-05-30 00:55
jadmin 閱讀(104)
評論(0) 編輯 收藏