搜索
 找回密码
 加入

发些经典的代码....

yellky 2007-3-9 16:40:57 3225
1.MARQUEE还能这样用!!

  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <marquee behavior="alternate" height="400" direction="up" scrollamount="3" scrolldelay="30" width="500" bgcolor="#3399FF">
  6. <marquee behavior="alternate" height="50" direction="left" scrollamount="3" scrolldelay="30" width="100%">
  7. <font style="font-size: 35px">MARQUEE</font>
  8. </marquee>
  9. </marquee>
  10. </body>
  11. </html>
复制代码


  1. <center>
  2.   <marquee direction="up" onmouseover=this.stop() onmouseout=this.start()

  3. scrollamount=3 WIDTH=100% Height=200 STYLE="filter:wave(add=1, phase=1,

  4. freq=2, strength=50);COLORTAG="#00FF00"><center><FONT color=#339900

  5. size=4>好好学习,<br>天天向上!<b><center> </font>
  6. </marquee>
复制代码

11 回复

yellky
2007-3-7 21:01:05
楼主

骇客帝国

点击查看详情
<table border=0 HEIGHT=20 border="0" cellspacing="0" cellpadding="0" STYLE="BGCOLOR:BLACK;COLOR:GREEN;"><tr STYLE="BGCOLOR:BLACK">
<td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=3>1<br>A<br>B<br>C<br>D<br>2<br>3<br>4<br>5<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=5>1<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>2<br>3<br>A<br>B<br>C<br>D<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=6>1<br>2<br>3<br>4<br>5<br>6<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=2>1<br>2<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=9>1<br>2<br>3<br>4<br>5<br>6<br>7<br>A<br>B<br>C<br>D<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=-1>1<br>2<br>3<br>4<br>5<br>6<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=5>1<br>A<br>B<br>C<br>D<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=7>1<br>2<br>3<br>4<br>5<br>6<br>7<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=4>1<br>2<br>3<br>4<br>5<br>6<br>A<br>B<br>C<br>D<br>7<br>8<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=1>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=8>1<br>2<br>3<br>A<br>B<br>C<br>D<br>4<br>5<br>6<br>7<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=3>1<br>2<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=5>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=6>1<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=2>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=9>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>9<br>0</marquee></td><td width=10 bgcolor="black"><marquee direction=down SCROLLAMOUNT=-1>A<br>B<br>C<br>D<br>E<br>F<br>1<br>2<br>3<br>4<br>5<br>6<br>7<br>G<BR>H<BR>I<BR>J<BR>K<BR>L<BR>M<BR>N<BR>8<br>9<br>0</marquee></td></tr></table>
yellky
2007-3-7 21:10:55
楼主
<style type="text/css">
               
                ul#hovershow2{
                        list-style-type: none;
                        margin: 50px;
                        width:200px;
                        float: left;
                        display: inline;
                        clear: both;
                }
                ul#hovershow2 li{
                        float: left;
                        display: inline;
                        width:20px;
                        height: 20px;
                        margin: 2px;
                                       
                }
                ul#hovershow2 li a {
                        text-decoration: none;
                        display: block;
                        width:20px;
                        height:20px;
                        border:1px red solid;
                        background-color: White;
                        line-height: 20px;
                        font-size: 12px;
                        text-align: center;
                }

                ul#hovershow2 li a:hover{
                position: absolute;
                width:40px;
                height: 40px;
                line-height: 40px;
                font-size: 32px;
                z-index:100;
                margin: -10px 0 0 -10px;
                }
               
        </style>


<ul id="hovershow2">
        <li><a href="1#" title="test"><span>1</span></a></li>
        <li><a href="2#" title="test"><span>2</span></a></li>
        <li><a href="3#" title="test"><span>3</span></a></li>
        <li><a href="4#" title="test"><span>4</span></a></li>
        <li><a href="5#" title="test"><span>5</span></a></li>
        <li><a href="6#" title="test"><span>6</span></a></li>
        <li><a href="7#" title="test"><span>7</span></a></li>
</ul>
yellky
2007-3-7 21:16:14
楼主
■打开■
<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■另存为■
<input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■属性■
<input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■打印■
<input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■页面设置■
<input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT>
■刷新■
<input type=button value=刷新 name=refresh onclick="window.location.reload()">
■导入收藏■
<input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,);>
■导出收藏■
<input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,);>
■加入收藏■
<INPUT name=Button2 onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹>
■整理收藏夹■
<INPUT name=Submit2 onclick="window.external.ShowBrowserUI(OrganizeFavorites, null)" type=button value=整理收藏夹>
■查看源文件■
<INPUT name=Button onclick=window.location = "view-source:" + window.location.href type=button value=查看源文件>
■语言设置■
<INPUT name=Button onclick="window.external.ShowBrowserUI(LanguageDialog, null)" type=button value=语言设置>
■前进■
<INPUT name=Submit onclick=history.go(1) type=submit value=前进>
■后退■
<INPUT name=Submit2 onclick=history.go(-1) type=submit value=后退>
yellky
2007-3-7 23:02:40
楼主

颜色拾取器


  1. <head><script>function colorpicker() {var sColor=dlgHelper.ChooseColorDlg();ColorVal=sColor.toString(16);colorvalue.value=(ColorVal.length==6)?"#"+ColorVal.toUpperCase():"#"+(new Array(6-ColorVal.length+1).join("0"))+ColorVal.toUpperCase();clipboardData.setData('text',colorvalue.value);colorvalue.selected();}</script></head><body><OBJECT id=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" WIDTH="0px" HEIGHT="0px"></OBJECT><input type="button" value="Color Picker" onclick="colorpicker()"><input type="text" name=colorvalue></body>
复制代码
yellky
2007-3-7 23:09:47
楼主

获取系统字体

  1. <!--
  2. 宝玉 2004-2-26
  3. [url]http://www.webuc.net[/url]
  4. [url]http://www.nwpubbs.net[/url]
  5. -->
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  7. <HTML>
  8. <HEAD>
  9. <TITLE> 获取当前系统字体和排版样式 </TITLE>

  10. <SCRIPT LANGUAGE="JavaScript">
  11. <!--
  12. function getSystemFonts(){
  13.     var a=dlgHelper.fonts.count;
  14.     var fArray = new Array();
  15.     var oDropDown = document.all.fonts;
  16.     for (i = 1;i < dlgHelper.fonts.count;i++){
  17.         fArray[i] = dlgHelper.fonts(i);
  18.         var aOptions = oDropDown.options;   
  19.         var oOption = document.createElement("OPTION");
  20.         aOptions.add(oOption);   
  21.         oOption.text = fArray[i];
  22.         oOption.Value = i;
  23.     }
  24. }

  25. function getBlockFormats(){
  26.     var a=dlgHelper.blockFormats.count;
  27.     var fArray = new Array();
  28.     var oDropDown = document.all.formats;
  29.     oDropDown.setAttribute("id","FormatList");
  30.     for (i = 1;i < dlgHelper.blockFormats.count;i++)
  31.     {
  32.         fArray[i] = dlgHelper.blockFormats(i);
  33.         var aOptions = oDropDown.options;   
  34.         var oOption = document.createElement("OPTION");
  35.         aOptions.add(oOption);   
  36.         oOption.text = fArray[i];
  37.         oOption.Value = i;
  38.     }
  39. }
  40. //-->
  41. </SCRIPT>
  42. </HEAD>

  43. <BODY onload="getSystemFonts();getBlockFormats()">
  44. 系统字体和排版样式 SystemFont and BlockFormats<BR>
  45. <SELECT NAME="fonts" onchange="document.body.style.fontFamily = this.options[this.selectedIndex].text">
  46. </SELECT>
  47. <SELECT NAME="formats" onchange="document.body.style.fontFamily = this.options[this.selectedIndex].text">
  48. </SELECT>
  49. <OBJECT ID=dlgHelper CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" WIDTH="0px" HEIGHT="0px"></OBJECT>
  50. </BODY>
  51. </HTML>
复制代码
yellky
2007-3-7 23:56:47
楼主

日历控件


  1. <html>
  2. <head>
  3. <title>设置日期            ...</title>
  4. <style type="text/css">
  5. .body,td{font-family:"Arial";font-size:8pt;color:#000000;}
  6. .TrOut{background:#dddddd;height:26;border:1 solid #999999;border-top-color:#f4f4f4;
  7. border-left-color:#f4f4f4;}
  8. .TdOver{background:#eeeeee;height:20;border:1 solid #ffffff;border-top-color:#9c9c9c;border-left-color:#9c9c9c;}
  9. .TdOut{background:#eeeeee;height:20;border:1 solid #9c9c9c;border-top-color:#ffffff;border-left-color:#ffffff;}
  10. </style>
  11. </head>
  12. <body scroll=no>
  13. <script language="JScript">
  14. /*********************************************************
  15.                 迷你日历1.0版本

  16. 如果下列代码发现bug请联系 [email][email protected][/email]

  17. 函数 TableFunction 提供以下方法和属性:
  18. &#402;.GetDateStr()
  19. 返回指定年月的日期的数组,包括空字符.
  20. 参数:
  21. y是指年
  22. m是指月
  23. 调用方式:TableFunction().GetDateStr(Year,Month)
  24. &#8222;.GetTableStr()
  25. 返回指定年月的已经格式化了的表格
  26. 参数:
  27. y是指年
  28. m是指月
  29. 调用方式:TableFunction().GetTableStr(Year,Month)
  30. ….WriteSelect()
  31. 返回年月的选择框
  32. 参数:
  33. obj是指需要加入选择框的容器
  34. values是指需要加亮的项目
  35. action是指参数,带入参数y表示是年选择框,带入参数m表示月选择框
  36. getobj是指在哪个控件上触发的事件,其中true为非当前选择框触发
  37. 而false则为当前选择框触发
  38. 调用方式:TableFunction().WriteSelect(obj,values,action,getobj)
  39. &#8224;.RewriteTableStr()
  40. 复位重写表格中的日期
  41. 参数:
  42. y是指年
  43. m是指月
  44. 调用方式:TableFunction().RewriteTableStr(Year,Month)
  45. &#8225;.JumpToRun()
  46. 左右控制表格中的月变化
  47. 参数:
  48. action表示日历是前进还是后退
  49. 调用方式:TableFunction().JumpToRun(action)
  50. &#710;.AlertDay()
  51. 提示当前点击的位置的日期
  52. 参数:

  53. 调用方式:TableFunction().AlertDay()
  54. *********************************************************/
  55. function TableFunction(){
  56.         this.GetDateStr=function(y,m){
  57.                 this.DayArray=[];
  58.                 for(var i=0;i<42;i++)this.DayArray[i]="&nbsp;";
  59.                 for(var i=0;i<new Date(y,m,0).getDate();i++)this.DayArray[i+new Date(y,m-1,1).getDay()]=i+1;
  60.                 return this.DayArray;
  61.                 }
  62.         this.GetTableStr=function(y,m){
  63.                 this.DateArray=["日","一","二","三","四","五","六"];
  64.                 this.DStr="<table oncontextmenu='return false' onselectstart='return false' style='width:160;cursor:default;border:1 solid #9c9c9c;border-right:0;border-bottom:0;filter:progid:dximagetransform.microsoft.dropshadow(color=#e3e3e3,offx=3,offy=3,positive=true)' border='0' cellpadding='0' cellspacing='0'>\n"+
  65.                 "<tr><td colspan='7' class='TrOut'>"+
  66.                 "<table width='100%' height='100%'border='0' cellpadding='0' cellspacing='0'><tr align='center'>\n"+
  67.                 "<td width='20' style='font-family:"webdings";font-size:9pt' onclick='TableFunction().JumpToRun("b")' onmouseover='this.style.color="#ff9900"' onmouseout='this.style.color=""'>3</td>\n"+
  68.                 "<td id='YearTD' width='70' onmouseover='this.style.background="#cccccc"' onmouseout='this.style.background=""' onclick='TableFunction().WriteSelect(this,this.innerText.split(" ")[0],"y",false)'>"+y+" 年</td>\n"+
  69.                 "<td id='MonthTD' width='47' onmouseover='this.style.background="#cccccc"' onmouseout='this.style.background=""' onclick='TableFunction().WriteSelect(this,this.innerText.split(" ")[0],"m",false)'>"+m+" 月</td>\n"+
  70.                 "<td width='20' style='font-family:"webdings";font-size:9pt' onclick='TableFunction().JumpToRun("n")' onmouseover='this.style.color="#ff9900"' onmouseout='this.style.color=""'>4</td></tr></table>\n"+
  71.                 "</td></tr>\n"+
  72.                 "<tr align='center'>\n";
  73.                 for(var i=0;i<7;i++)
  74.                 this.DStr+="<td class='TrOut'>"+DateArray[i]+"</td>\n";
  75.                 this.DStr+="</tr>\n";
  76.                 for(var i=0;i<6;i++){
  77.                 this.DStr+="<tr align='center'>\n";
  78.                 for(var j=0;j<7;j++){
  79.                         var CS=defaultDate.getDate()==this.GetDateStr(y,m)[i*7+j]?"TdOver":"TdOut";
  80.                         this.DStr+="<td id='TD' class='"+CS+"' cs='"+CS+"' onmouseover='this.className="TdOver"' onmouseout='if(this.cs!="TdOver")this.className="TdOut"' onclick='TableFunction().AlertDay()'>"+this.GetDateStr(y,m)[i*7+j]+"</td>\n";
  81.                         }
  82.                 this.DStr+="</tr>\n";
  83.                 }
  84.                 this.DStr+="</tabe>";
  85.                 return this.DStr;
  86.                 }
  87.         this.WriteSelect=function(obj,values,action,getobj){
  88.                 if(values=="")return;
  89.                 if(getobj){
  90.                         obj.innerHTML=values+(action=="y"?" 年":" 月");
  91.                         this.RewriteTableStr(YearTD.innerText.split(" ")[0],MonthTD.innerText.split(" ")[0]);
  92.                         return false;
  93.                         }
  94.                 var StrArray=[];
  95.                 if(action=="y"){
  96.                         for(var i=0;i<15;i++){
  97.                                 var year=values-7+i;
  98.                                 StrArray[i]="<option value='"+year+"' "+(values==year?"selected":"")+"> "+year+"年</option>\n";
  99.                                 }
  100.                         obj.innerHTML="<select id='select1' style='width:67' onchange='TableFunction().WriteSelect(parentElement,this.value,"y",true)' onblur='YearTD.innerText=this.value+" 年"'>\n"+StrArray.join("")+"</select>";
  101.                         select1.focus();
  102.                         }
  103.                 if(action=="m"){
  104.                         for(var i=1;i<13;i++)
  105.                                 StrArray[i]="<option value='"+i+"' "+(i==values?"selected":"")+"> "+i+"月</option>\n";
  106.                         obj.innerHTML="<select id='select2' style='width:47' onchange='TableFunction().WriteSelect(parentElement,this.value,"m",true)' onblur='MonthTD.innerText=this.value+" 月"'>\n"+StrArray.join("")+"</select>";
  107.                         select2.focus();
  108.                         }
  109.                 }
  110.         this.RewriteTableStr=function(y,m){
  111.                 var TArray=this.GetDateStr(y,m);
  112.                 var len=TArray.length;
  113.                 for(var i=0;i<len;i++){
  114.                         TD[i].innerHTML=TArray[i];
  115.                         TD[i].className="TdOut";
  116.                         TD[i].cs="TdOut";
  117.                         if(new Date().getYear()==y&&new Date().getMonth()+1==m&&new Date().getDate()==TArray[i]){
  118.                                 TD[i].className="TdOver";
  119.                                 TD[i].cs="TdOver";
  120.                                 }
  121.                         }
  122.                 }
  123.         this.JumpToRun=function(action){
  124.                 var YearNO=YearTD.innerText.split(' ')[0];
  125.                 var MonthNO=MonthTD.innerText.split(' ')[0];
  126.                 if(action=="b"){
  127.                         if(MonthNO=="1"){
  128.                                 MonthNO=13;
  129.                                 YearNO=YearNO-1;
  130.                                 }
  131.                         MonthTD.innerText=MonthNO-1+" 月";
  132.                         YearTD.innerText=YearNO+" 年";
  133.                         this.RewriteTableStr(YearNO,MonthNO-1);
  134.                         }
  135.                 if(action=="n"){
  136.                         if(MonthNO=="12"){
  137.                                 MonthNO=0;
  138.                                 YearNO=YearNO-(-1);
  139.                                 }
  140.                         YearTD.innerText=YearNO+" 年";
  141.                         MonthTD.innerText=MonthNO-(-1)+" 月";
  142.                         this.RewriteTableStr(YearNO,MonthNO-(-1));
  143.                         }
  144.                 }
  145.         this.AlertDay=function(){
  146.                 if(event.srcElement.innerText!=" "){
  147.                         var d=new Date( parseInt(YearTD.innerText.split(' ')[0],10),parseInt(MonthTD.innerText.split(' ')[0],10)-1,parseInt(event.srcElement.innerText,10));
  148.                         window.returnValue=d.getTime();
  149.                         window.close();//点击日期会关闭窗口
  150.                         }
  151.                 }
  152.         return this;
  153.         }
  154. var defaultDate=new Date();
  155. if(typeof(dialogArguments)!="undefined")defaultDate=dialogArguments;
  156. document.write(TableFunction().GetTableStr(defaultDate.getYear(),defaultDate.getMonth()+1));
  157. </script>
  158. </body>
  159. </html>
复制代码
admin
2007-3-8 00:00:04
原帖由 yellky 于 2007-3-7 23:02 发表

<head><script>function colorpicker() {var sColor=dlgHelper.ChooseColorDlg();ColorVal=sColor.toString(16);colorvalue.value=(ColorVal.length==6)?"#"+ColorVal.toUpperCase():& ...

这个不错。呵呵
clheart
2007-3-9 16:33:45
没教程,看不了
yellky
2007-3-9 16:40:57
楼主
原帖由 clheart 于 2007-3-9 16:33 发表
没教程,看不了



代码就是最好的教程

偶从来都没耐心看教程,直接看代码,看多了就贯通了....:)
12下一页
高级模式
游客