idc网站html源码,40个网页常用小代码
1、
οncοntextmenu="window.event.returnValue=false" 將徹底屏蔽鼠標右鍵 中.國站長站
可用于Table 中.國.站.長.站2、
取消選取、防止復制Chinaz.com
3、οnpaste="return false" 不準粘貼 Chinaz_com
4、οncοpy="return false;" oncut="return false;" 防止復制
中.國.站長站
5、 IE地址欄前換成自己的圖標 Www@Chinaz@com
6、 可以在收藏夾中顯示出你的圖標 站.長站
7、 關閉輸入法
中.國.站.長.站
8、永遠都會帶著框架
Chinaz_com
以下為引用的內容:
if (window == top)top.location.href = "frames.htm"; //frames.htm為框架網頁
// –>
[中國站長站]
9、防止被人frame
中.國站長站
以下為引用的內容:
if (top.location != self.location)top.location=self.location;
// –>
中國.站長站
10、網頁將不能被另存為
[中國站長站]
Chinaz.com11、
οnclick="window.location = ‘view-source:’+ ‘http://www.webjx.com/’">
Chinaz~com
12、刪除時確認 中國.站.長站
刪除
中.國.站長站
13、取得控件的絕對位置
Www~Chinaz~com
以下為引用的內容:
//Javascript
function 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);
}
Www~Chinaz~com
//VBScript
function getIE()
dim t,l,a,b
set a=document.all.img1
t=document.all.img1.offsetTop
l=document.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 function
–>
Chinaz@com
中國站.長.站
14、光標是停在文本框文字的最后 中國站.長站
以下為引用的內容:
function cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart(‘character’,e.value.length);
r.collapse(true);
r.select();
}
Chinaz
15、判斷上一頁的來源 [中國站長站]
javascript:document.referrer
Chinaz.com
16、最小化、最大化、關閉窗口
中.國.站長站
以下為引用的內容:
中國站.長站
中.國.站長站
中.國站長站
本例適用于IE
站.長.站
17、屏蔽功能鍵Shift,Alt,Ctrl 站長.站
以下為引用的內容:
function look(){
if(event.shiftKey)
alert("禁止按Shift鍵!"); //可以換成ALT CTRL
}
document.οnkeydοwn=look;
中國站.長站
18、網頁不會被緩存
中國站長_站,為中文網站提供動力
以下為引用的內容:
站.長站
或者
中.國.站.長.站
19、怎樣讓表單沒有凹凸感?
Www_Chinaz_com
中國.站長站
或 中.國.站長站
[中國站長站]
20、
&的區別? Chinaz@com(division)用來定義大段的頁面元素,會產生轉行中國.站.長站
用來定義同一行內的元素,跟
的唯一區別是不產生轉行Www~Chinaz~com
是ns的標記,ie不支持,相當于
中.國站長站
21、讓彈出窗口總是在最上面:
中.國.站長站
22、不要滾動條? Chinaz_com
讓豎條沒有:
Chinaz~com
以下為引用的內容:
中.國.站長站
讓橫條沒有:
Chinaz.com
以下為引用的內容:
中國站長_站,為中文網站提供動力
兩個都去掉?更簡單了
中.國.站.長.站
以下為引用的內容:
站長.站
23、怎樣去掉圖片鏈接點擊后,圖片周圍的虛線?
[中國站長站]
站.長.站
24、電子郵件處理提交表單 站.長站
以下為引用的內容:
中國站長.站
25、在打開的子窗口刷新父窗口的代碼里如何寫? Www~Chinaz~com
window.opener.location.reload() 站.長站
26、如何設定打開頁面的大小
中國站長.站
Chinaz_com
打開頁面的位置
中國.站長站27、在頁面中如何加入不是滿鋪的背景圖片,拉動頁面時背景圖不動
站長.站
以下為引用的內容:
body
{background-image:url(logo.gif); background-repeat:no-repeat; 中國站.長.站
background-position:center;background-attachment: fixed}
Chinaz@com
中國站長_站,為中文網站提供動力
28、檢查一段字符串是否全由數字組成 中國.站長站
以下為引用的內容:
function checkNum(str){return str.match(//D/)==null}
alert(checkNum("1232142141"))
alert(checkNum("123214214a1"))
// –>
Chinaz@com
29、獲得一個窗口的大小 Www^Chinaz^com
document.body.clientWidth; document.body.clientHeight 站.長站
30、怎么判斷是否是字符 中國站長_站,為中文網站提供動力
以下為引用的內容:
if (/[^/x00-/xff]/g.test(s)) alert("含有漢字");
else alert("全是字符");
[中國站長站]
31、TEXTAREA自適應文字行數的多少 中國站長.站
以下為引用的內容: Www~Chinaz~com
中國站長.站
中.國站長站
32、日期減去天數等于第二個日期
中.國.站長站
以下為引用的內容:
function cc(dd,dadd)
{
//可以加上錯誤處理
var a = new Date(dd)
a = a.valueOf()
a = a – dadd * 24 * 60 * 60 * 1000
a = new Date(a)
alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日")
}
cc("12/23/2002",2)
中國站.長.站
33、選擇了哪一個Radio
Chinaz@com
以下為引用的內容:
function checkme()
for each ob in radio1
if ob.checked then window.alert ob.value
next
end function
Style
Barcode
[中國站長站]
34、腳本永不出錯
站.長站
以下為引用的內容:
function killErrors() {
return true;
}
window.onerror = killErrors;
// –>
站長.站
35、ENTER鍵可以讓光標移到下一個輸入框
中.國.站.長.站
Chinaz~com
36、檢測某個網站的鏈接速度: Www^Chinaz^com
把如下代碼加入
區域中: Chinaz@com以下為引用的內容:
tim=1
setInterval("tim++",100)
b=1 中國站長.站
var autourl=new Array()
autourl[1]="www.njcatv.net"
autourl[2]=www.webjx.com
autourl[3]="www.sina.com.cn"
autourl[4]="www.nuaa.edu.cn"
autourl[5]="www.cctv.com"
中國站.長站
function butt(){
document.write("
")for(var i=1;i
document.write(" =》
name=url"+i+" size=40> =》
Www~Chinaz~com
οnclick=window.open(this.form.url"+i+".value)>
")
document.write("
")}
butt()
function auto(url){
document.forms[0]["url"+b].value=url
if(tim>200)
{document.forms[0]["txt"+b].value="鏈接超時"}
else
{document.forms[0]["txt"+b].value="時間"+tim/10+"秒"}
b++
}
function run(){for(var i=1;i
src=http://"+autourl+"/"+Math.random()+" width=1 height=1 Chinaz_com
οnerrοr=auto(‘http://"+autourl+"’)>")}
run() 中.國.站.長.站
站.長站
37、各種樣式的光標
站長.站
auto :標準光標
Chinaz~com
default :標準箭頭
Www^Chinaz^com
hand :手形光標
站長.站
wait :等待光標 Chinaz.com
text :I形光標
Chinaz
vertical-text :水平I形光標 站.長站
no-drop :不可拖動光標 Chinaz~com
not-allowed :無效光標
Www^Chinaz^com
help :?幫助光標
Www.Chinaz.com
all-scroll :三角方向標
中.國站長站
move :移動標 站.長.站
crosshair :十字標
Www.Chinaz.com
e-resize 站.長站
n-resize Www^Chinaz^com
nw-resize
Chinaz@com
w-resize Chinaz@com
s-resize Www@Chinaz@com
se-resize
中國站長_站,為中文網站提供動力
sw-resize
中國站.長站
38、頁面進入和退出的特效
站長.站
進入頁面 Chinaz_com
推出頁面 中國.站長站
這個是頁面被載入和調出時的一些特效。duration表示特效的持續時間,以秒為單位。transition表示使 Www~Chinaz~com
用哪種特效,取值為1-23: Www^Chinaz^com
0 矩形縮小 站.長.站
1 矩形擴大 Www.Chinaz.com
2 圓形縮小
中國站.長站
3 圓形擴大
中.國.站長站
4 下到上刷新
Www@Chinaz@com
5 上到下刷新
中.國.站長站
6 左到右刷新 中國.站長站
7 右到左刷新
[中國站長站]
8 豎百葉窗 中國站長_站,為中文網站提供動力
9 橫百葉窗 中.國站長站
10 錯位橫百葉窗 Chinaz
11 錯位豎百葉窗
Www.Chinaz.com
12 點擴散
站.長站
13 左右到中間刷新 站長.站
14 中間到左右刷新 Www~Chinaz~com
15 中間到上下 中國站長.站
16 上下到中間 站長.站
17 右下到左上
中.國站長站
18 右上到左下 Chinaz
19 左上到右下 Chinaz_com
20 左下到右上
中國站.長站
21 橫條 中.國.站長站
22 豎條
Www^Chinaz^com
23 以上22種隨機選擇一種 中國.站長站
39、在規定時間內跳轉
Www^Chinaz^com
中.國.站長站
40、網頁是否被檢索 中國站.長站
中.國.站.長.站
其中屬性值有以下一些:
中.國.站.長.站
屬性值為"all": 文件將被檢索,且頁上鏈接可被查詢; Chinaz~com
屬性值為"none": 文件不被檢索,而且不查詢頁上的鏈接; 中國站長_站,為中文網站提供動力
屬性值為"index": 文件將被檢索;
屬性值為"follow": 查詢頁上的鏈接;
屬性值為"noindex": 文件不檢索,但可被查詢鏈接;
屬性值為"nofollow": 文件不被檢索,但可查詢頁上的鏈接。
總結
以上是生活随笔為你收集整理的idc网站html源码,40个网页常用小代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 中职计算机专业选修课程,中职学校计算机专
- 下一篇: 淮海工学院计算机组成原理,淮海工学院11