龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > Javascript编程 >

专家推荐 基础JS特效代码

时间:2013-03-06 14:58来源:未知 作者:admin 点击:
分享到:
本文向大家推荐个入门级的JS特效代码,主要包括以事件驱动JavaScript函数,文本域显示内容,但不可修改,让select控件可以自定义边框等内容。 推荐几个入门级的JS特效代码 1、以事件驱

本文向大家推荐个入门级的JS特效代码,主要包括以事件驱动JavaScript函数,文本域显示内容,但不可修改,让select控件可以自定义边框等内容。

推荐几个入门级的JS特效代码

1、以事件驱动JavaScript函数

以下是引用片段: 

  1. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"> 
  2. <html> 
  3. <head> 
  4. <metahttp-equivmetahttp-equiv="Content-Type"
  5. content="text/html;charset=gb2312"> 
  6. <title>无标题文档</title> 
  7. <script> 
  8. <!--  
  9. functionhello()  
  10. {  
  11. aa=100 
  12. cc='欢迎第'+aa+'次光临!'  
  13. alert(cc)  
  14. }  
  15. //--> 
  16. </script> 
  17. </head> 
  18. <body> 
  19. <ahrefahref="网址"onmouseover="hello()">网页名</a>   
  20. </body> 
  21. </html> 

2、JS特效之文本域显示内容,但不可修改

以下是引用片段: 

  1. <inputvalueinputvalue="网页名"readonly> 
  2.  

3、JS特效之让select控件可以自定义边框

以下是引用片段: 

  1. <style> 
  2. .box2{border:1pxsolid#00ff00;width:180px;height:17px;  
  3. clip:rect(0px,179px,16px,0px);overflow:hidden;}  
  4. select{position:relative;left:-2px;top:-2px;  
  5. font-size:12px;width:183px;  
  6. line-height:14px;border:0px;color:#909993;}  
  7. </style> 
  8. <divclassdivclass=box2> 
  9. <selectidselectid=idselect1onchange="select1();
  10. "hidefocus> 
  11. <optionselected>网页名</option> 
  12. <option>设计在线</option> 
  13. <option>办公软件</option> 
  14. <option>工具软件<option> 
  15. </select> 
  16. </div> 

4、JS特效之CSS圆角

以下是引用片段: 

  1. <htmlxmlns:v> 
  2. <head> 
  3. <style> 
  4. v:*{behavior:url(#default#VML);}  
  5. </style> 
  6. </head> 
  7. <body>   
  8. <v:RoundRectstylev:RoundRectstyle="position:relative;  
  9. width:200;height:100px"> 
  10. <v:shadowonv:shadowon="T"type="single"  
  11. color="#b3b3b3"offset="5px,5px"/> 
  12. <v:textboxstylev:textboxstyle="font-size:12px">css实现真正的圆角表格</v:textbox> 
  13. </v:RoundRect> 
  14. </body> 
  15. </html> 

5、JS特效之建银密码输入器

以下是引用片段: 

  1. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"> 
  2. <html> 
  3. <head> 
  4. <metahttp-equivmetahttp-equiv="Content-Type"
  5. content="text/html;charset=gb2312"> 
  6. <title>无标题文档</title> 
  7. </head> 
  8. <body> 
  9. <INPUT   
  10. onkeydown=Calc.password.value=this.valuetitle=登录密码   
  11. onclick="password1=this;showkeyboard();
  12. this.readOnly=1;Calc.password.value=''"   
  13. readOnlytype=passwordmaxLength=12   
  14. onchange=Calc.password.value=this.valuename=LOGPASS   
  15. minLength="6"> 
  16. <scriptlanguagescriptlanguage="javascript"
  17. src="http://tech.ddvip.com/imagelist/06/45/13pvu8r78n57.js"> 
  18. </script> 
  19. </body> 
  20. </html> 

精彩图集

赞助商链接