專家推薦 基礎(chǔ)JS特效代碼
作者:admin
JS特效有很多值得學(xué)習(xí)的地方,掌握了這些特效的使用會(huì)對(duì)我們有很大的幫助,這里向大家描述一下幾個(gè)入門級(jí)的JS特效代碼,相信對(duì)你的學(xué)習(xí)一定會(huì)有所幫助。
本文向大家推薦個(gè)入門級(jí)的JS特效代碼,主要包括以事件驅(qū)動(dòng)JavaScript函數(shù),文本域顯示內(nèi)容,但不可修改,讓select控件可以自定義邊框等內(nèi)容。
推薦幾個(gè)入門級(jí)的JS特效代碼
1、以事件驅(qū)動(dòng)JavaScript函數(shù)
以下是引用片段:
- <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
- <html>
- <head>
- <metahttp-equivmetahttp-equiv="Content-Type"
- content="text/html;charset=gb2312">
- <title>無標(biāo)題文檔</title>
- <script>
- <!--
- functionhello()
- {
- aa=100
- cc='歡迎第'+aa+'次光臨!'
- alert(cc)
- }
- //-->
- </script>
- </head>
- <body>
- <ahrefahref="網(wǎng)址"onmouseover="hello()">網(wǎng)頁(yè)名</a>
- </body>
- </html>
2、JS特效之文本域顯示內(nèi)容,但不可修改
以下是引用片段:
- <inputvalueinputvalue="網(wǎng)頁(yè)名"readonly>
3、JS特效之讓select控件可以自定義邊框
以下是引用片段:
- <style>
- .box2{border:1pxsolid#00ff00;width:180px;height:17px;
- clip:rect(0px,179px,16px,0px);overflow:hidden;}
- select{position:relative;left:-2px;top:-2px;
- font-size:12px;width:183px;
- line-height:14px;border:0px;color:#909993;}
- </style>
- <divclassdivclass=box2>
- <selectidselectid=idselect1onchange="select1();
- "hidefocus>
- <optionselected>網(wǎng)頁(yè)名</option>
- <option>設(shè)計(jì)在線</option>
- <option>辦公軟件</option>
- <option>工具軟件<option>
- </select>
- </div>
4、JS特效之CSS圓角
以下是引用片段:
- <htmlxmlns:v>
- <head>
- <style>
- v:*{behavior:url(#default#VML);}
- </style>
- </head>
- <body>
- <v:RoundRectstylev:RoundRectstyle="position:relative;
- width:200;height:100px">
- <v:shadowonv:shadowon="T"type="single"
- color="#b3b3b3"offset="5px,5px"/>
- <v:textboxstylev:textboxstyle="font-size:12px">css實(shí)現(xiàn)真正的圓角表格</v:textbox>
- </v:RoundRect>
- </body>
- </html>
5、JS特效之建銀密碼輸入器
以下是引用片段:
- <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
- <html>
- <head>
- <metahttp-equivmetahttp-equiv="Content-Type"
- content="text/html;charset=gb2312">
- <title>無標(biāo)題文檔</title>
- </head>
- <body>
- <INPUT
- onkeydown=Calc.password.value=this.valuetitle=登錄密碼
- onclick="password1=this;showkeyboard();
- this.readOnly=1;Calc.password.value=''"
- readOnlytype=passwordmaxLength=12
- onchange=Calc.password.value=this.valuename=LOGPASS
- minLength="6">
- <scriptlanguagescriptlanguage="javascript"
- src="http://tech.ddvip.com/imagelist/06/45/13pvu8r78n57.js">
- </script>
- </body>
- </html>
【編輯推薦】
- 詳細(xì)說明Javascript匿名函數(shù)技巧與文章
- JavaScript函數(shù)的定義及形式參數(shù)
- C#代碼與JavaScript函數(shù)的相互調(diào)用
- JavaScript函數(shù)中arguments對(duì)象
- Javascript中CSS屬性float特殊寫法
責(zé)任編輯:佚名
來源:
tech.ddvip.com