Fri

20

Mar

2009

151、检测健康程度

151、检测健康程度

脚本说明:

把如下代码加入<body>区域中:

<script LANGUAGE="JAVASCRIPT">

 

<!-- hide this script tag's contents from old browsers

 

function ClearForm(form){

 

    form.weight.value = "";

 

    form.height.value = "";

 

    form.bmi.value = "";

 

    form.my_comment.value = "";

 

}

 

 

 

function bmi(weight, height) {

 

          bmindx=weight/eval(height*height);

 

          return bmindx;

 

}

 

function checkform(form) {

 

       if (form.weight.value==null||form.weight.value.length==0

 

        || form.height.value==null||form.height.value.length==0){

 

            alert("\nPlease complete the form first");

 

            return false;

 

       }

 

       else if (parseFloat(form.height.value) <= 0||

 

                parseFloat(form.height.value) >=500||

 

                parseFloat(form.weight.value) <= 0||

 

                parseFloat(form.weight.value) >=500){

 

                alert("\nReally know what you're doing? \nPlease enter values again. \nWeight in kilos and \nheight in cm");

 

                ClearForm(form);

 

                return false;

 

       }

 

       return true;

 

}

 

function computeform(form) {

 

       if (checkform(form)) {

 

       yourbmi=Math.round(bmi(form.weight.value, form.height.value/100));

 

       form.bmi.value=yourbmi;

 

       if (yourbmi >30) {

 

          form.my_comment.value="不要在闹了!!!";

 

       }

 

       else if (yourbmi >28 && yourbmi <=30) {

 

          form.my_comment.value="您是猪吗?";

 

       }

 

       else if (yourbmi >23 && yourbmi <=28) {

 

          form.my_comment.value="两头猪也没有你重吧?";

 

       }

 

       else if (yourbmi >21 && yourbmi <=23) {

 

          form.my_comment.value="您现在是偏胖,应该注意饮食!";

 

       }

 

       else if (yourbmi >=19 && yourbmi <=21) {

 

          form.my_comment.value="!!!您太苗条了! 是标准身材";

 

       }

 

       else if (yourbmi >=18 && yourbmi <19) {

 

          form.my_comment.value="您是不是营养不良?????";

 

       }

 

       else if (yourbmi >=17 && yourbmi <18) {

 

          form.my_comment.value="这个不是骨头吗????";

 

       }

 

       else if (yourbmi <17) {

 

          form.my_comment.value="按照生物学来说这种生物是不能生存的";

 

       }

 

      }

 

       return;

 

}

 

 // -- done hiding from old browsers -->

 

 

 

 

</script>

 

 

<form NAME="BMI" method="POST">

  <table border="1">

    <tr>

      <td><font color="red"><div align="center"><center><p>体重</font> (kg)</td>

      <td align="center"><font color="red"><div align="center"><center><p>身高</font>(cm)</td>

      <td align="center"><font color="blue"><div align="center"><center><p>健康值</font></td>

      <td align="center"><font color="blue"><div align="center"><center><p>电脑对您的评价</font></td>

    </tr>

    <tr align="center">

      <td><input TYPE="TEXT" NAME="weight" SIZE="6" onFocus="this.form.weight.value=''"></td>

      <td><input TYPE="TEXT" NAME="height" SIZE="6" onFocus="this.form.height.value=''"></td>

      <td><input TYPE="TEXT" NAME="bmi" SIZE="5"></td>

      <td><input TYPE="TEXT" NAME="my_comment" size="40"></td>

    </tr>

  </table>

  <div align="center"><center><p><input TYPE="button" VALUE="确定"

  onClick="computeform(this.form)"> <input TYPE="reset" VALUE="取消"

  onClick="ClearForm(this.form)"> </p>

  </center></div>

</form>

 

0 Comments

Fri

20

Mar

2009

150、直接页面显示器

150、直接页面显示器

脚本说明:

把如下代码加入<body>区域中:

<script language="JavaScript">

 

function trestart(){

   if (script) {

   clear = confirm("你真的确定要关闭吗?",'');

   if(clear) {

   document.script.reset();

   document.script.value = "";

  }

 }

}    

 

function test(){

  {

  temp = document.script.tester.value;

  testwin= open("", "testwin","status=no,menubar=yes,toolbar=no");

  testwin.document.open();

  testwin.document.write(temp);

  testwin.document.close();

 }

}

 

function about(){

 alert("HTML代码直接显示出页面来")

 alert("http://www.javascript2000.com   E-mail:webmaster@javascript2000.com")

}

 

function help(){

 OpenWindow=window.open("", "newwin","height=420,width=470,toolbar=no,scrollbars="+scroll+",menubar=no");

 OpenWindow.document.write("<body bgcolor='white' text='black' alink='blue'vlink='blue' link='blue'><TITLE>帮助信息</TITLE>")

 OpenWindow.document.write("<center>你只要把你想显示的代码放到上页的输入框中,你自己也可以写代码,按显示键就能显示你的页面内容</center><br>")

 OpenWindow.document.write("<center><a href='mailto:webmaster@javascript2000.com' target='main'>Email me</a></Center><br>")

 OpenWindow.document.write("<center><a href='javascript:close()'>Close this window</a></Center>")

 OpenWindow.document.close()

 self.name="main"

}

 

//End hiding-->

</script>

<form name="script">

<textarea name="tester" rows="8" cols="50"

wrap="off"></textarea>

<br>

<input type="button" value="显示" onClick="test()"> 

<input type="button" value="清除" onClick="trestart()"> 

<input type="button" value="关于" onClick="about()"> 

<input type="button" value="帮助" onClick="help()">

</form>

 

0 Comments

Fri

20

Mar

2009

149、MIDI音乐选择

149MIDI音乐选择

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

 

<!--

function PlaySong(SongURL)

{

 

PopUp = window.open (SongURL, "Crescendo", "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizeable=no,copyhistory=no,width=200,height=30")

 

}

//-->

 

</SCRIPT>

<FORM NAME="midiform"><SELECT NAME="list"><OPTION VALUE="song4.mid" [SELECTED]>MIDI1_NAME

<OPTION VALUE="song2.mid">MIDI2_NAME

<OPTION VALUe="song3.mid">MIDI3_NAME

</SELECT>

<P><INPUT TYPE=BUTTON VALUE="PLAY MIDI" onClick="PlaySong(midiform.list.options[midiform.list.selectedIndex].value)">

</FORM>

 

 

0 Comments

Fri

20

Mar

2009

148、进入弹出收藏夹

148、进入弹出收藏夹

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var expDays = 7;

 

url = "http://www.7stk.com/";

title = "网页制作特效";

 

// Cookie code from The JavaScript Source

function GetCookie (name) { 

var arg = name + "="; 

var alen = arg.length; 

var clen = document.cookie.length; 

var i = 0; 

while (i < clen) {   

var j = i + alen;   

if (document.cookie.substring(i, j) == arg)     

return getCookieVal (j);   

i = document.cookie.indexOf(" ", i) + 1;   

if (i == 0) break;  

}  

return null;

}

function SetCookie (name, value) { 

var argv = SetCookie.arguments; 

var argc = SetCookie.arguments.length; 

var expires = (argc > 2) ? argv[2] : null; 

var path = (argc > 3) ? argv[3] : null; 

var domain = (argc > 4) ? argv[4] : null; 

var secure = (argc > 5) ? argv[5] : false; 

document.cookie = name + "=" + escape (value) +

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

((path == null) ? "" : ("; path=" + path)) + 

((domain == null) ? "" : ("; domain=" + domain)) +   

((secure == true) ? "; secure" : "");

}

function DeleteCookie (name) { 

var exp = new Date(); 

exp.setTime (exp.getTime() - 1); 

var cval = GetCookie (name); 

document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var exp = new Date();

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function amt(){

var count = GetCookie('count')

if(count == null) {

SetCookie('count','1')

return 1

}

else {

var newcount = parseInt(count) + 1;

DeleteCookie('count')

SetCookie('count',newcount,exp)

return count

   }

}

function getCookieVal(offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)

endstr = document.cookie.length;

return unescape(document.cookie.substring(offset, endstr));

}

 

function checkCount() {

var count = GetCookie('count');

if (count == null) {

count=1;

SetCookie('count', count, exp);

 

if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {

window.external.AddFavorite (url,title);

}

else {

var msg = "Don't forget to bookmark us!";

if(navigator.appName == "Netscape") msg += "  (CTRL-D)";

alert(msg);

   }

}

else {

count++;

SetCookie('count', count, exp);

   }

}

checkCount();

//  End -->

</script>

 

0 Comments

Fri

20

Mar

2009

147、自动显示是否更新

147、自动显示是否更新

脚本说明:

把如下代码加入<body>区域中

 

<TABLE border=2 cellspacing=0 cellpadding=3>

<TR><TD bgcolor="#000044">

<FONT color="#4400ff" face=georgia,arial size=+1>

<CENTER>

<SCRIPT LANGUAGE="JavaScript">

<!--

document.write(document.title);

//-->

</SCRIPT>

</TD></TR>

<TR><TD bgcolor="#440000">

<FONT size=-1 color="#ff0000" face="trebuchet MS","arial">

<FONT color="#ff8800">Born on:</font>

 

 

 

September 25, 1997

 

<br>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function getCookieVal (offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)

endstr = document.cookie.length;

return unescape(document.cookie.substring(offset, endstr));

}

function GetCookie (name) {

var arg = name + "=";

var alen = arg.length;

var clen = document.cookie.length;

var i = 0;

while (i < clen) {

var j = i + alen;

if (document.cookie.substring(i, j) == arg)

return getCookieVal (j);

i = document.cookie.indexOf(" ", i) + 1;

if (i == 0) break;

}

return null;

}

function SetCookie (name, value) {

var argv = SetCookie.arguments;

var argc = SetCookie.arguments.length;

var expires = (argc > 2) ? argv[2] : null;

var path = (argc > 3) ? argv[3] : null;

var domain = (argc > 4) ? argv[4] : null;

var secure = (argc > 5) ? argv[5] : false;

document.cookie = name + "=" + escape (value) +

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

((path == null) ? "" : ("; path=" + path)) +

((domain == null) ? "" : ("; domain=" + domain)) +

((secure == true) ? "; secure" : "");

}

function DeleteCookie(name) {

var exp = new Date();

FixCookieDate (exp);

exp.setTime (exp.getTime() - 1);

var cval = GetCookie (name);

if (cval != null)

document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();

}

var cookie_date=new Date(document.lastModified);

var expdate = new Date();

expdate.setTime(expdate.getTime()+(5*24*60*60*1000));

document.write("<Font color=ff8800>" + "Last updated: "+ "</font>" +document.lastModified);

document.write("");

if (!(cookie_date == GetCookie("cookie_date"))){

SetCookie("cookie_date",cookie_date,expdate);

document.write("<font color='yellow'><br>Site has changed since last visit!</font><br>");

}

// End -->

</SCRIPT>

</FONT>

</TD></TR>

</TABLE>

</CENTER>

 

0 Comments

Fri

20

Mar

2009

146、打印页面的按钮

146、打印页面的按钮

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

if (window.print) {

document.write('<form>不在忘记'

+ '<input type=button name=print value="Print" '

+ 'onClick="javascript:window.print()">本页!</form>');

}

// End -->

</script>

 

0 Comments

Fri

20

Mar

2009

145、最酷的计算器

145、最酷的计算器

脚本说明:

把如下代码加入<body>区域中

<SCRIPT Language="JavaScript">

function compute() {

   if (document.evalform.honoff.value=='off') return;

   document.evalform.result.value = eval(document.evalform.expr.value)

   qwqw = document.evalform.result.value

   for (var i = 3; i < 14; i++) {   

       document.images[i].src = "calc001/dgbl.gif"

   } 

 

   for (var i = 0; i <= qwqw.length-1; i++) {    

       var del = qwqw.substring(i, i+1);

       if (del=='.'){

              del='p2';

       }

       else if (del=='-'){

              del='min';

       }

       else if((del=='0') || (del == '1') || (del == '2')|| (del == '3')|| (del == '4')|| (del == '5')|| (del == '6')|| (del == '7')|| (del == '8')|| (del == '9')){

       }

       else {

              del = 'bl';

       }

 

       var nr = i+3

       if (nr > 13) {

              return;

       }

       document.images[nr].src = "calc001/dg" + del + ".gif"

   } 

 

}

 

function visa(n) {

   if (document.evalform.honoff.value=='off') return;

   var s=0;//STOP if operator

   document.evalform.expr.value = document.evalform.expr.value + n

   qwqw = document.evalform.expr.value

   if (document.evalform.help.value=='t'){

       for (var i = 3; i < 14; i++) { 

              document.images[i].src = "calc001/dgbl.gif"

       } 

       document.evalform.help.value=''

   }

 

   for (var i = 0; i <= qwqw.length-1; i++) {    

       var del = qwqw.substring(i, i+1);

   }

      

       s=0

       if((del=='+') || (del == '-') || (del == '*')|| (del == '/')|| (del == '(')|| (del == ')')){

              document.evalform.help.value='t'

              document.evalform.pos.value='2'

              var s=1;

       }

 

 

       if (del=='.'){

              del='p2';

       }

       else if (del=='-'){

              del='min';

       }

       else if((del=='0') || (del == '1') || (del == '2')|| (del == '3')|| (del == '4')|| (del == '5')|| (del == '6')|| (del == '7')|| (del == '8')|| (del == '9')){

              del=del;

       }

       else {

              del = 'bl';

       }

 

       var nr = document.evalform.pos.value;

       if (nr > 13) {

              return;

       }

       if (s == 0) document.images[nr].src = "calc001/dg" + del + ".gif"

       document.evalform.pos.value=parseInt(document.evalform.pos.value)+1;

 

 

}

function clear() {

   if (document.evalform.honoff.value=='off') return;

   document.evalform.expr.value = '';

   document.evalform.result.value = '';

   document.evalform.pos.value = '3';

   for (var i = 3; i < 14; i++) {   

       document.images[i].src = "calc001/dgbl.gif"

   } 

 

  

}

 

function onoff() {

   if (document.evalform.honoff.value=='off'){

     for (var i = 2; i < 13; i++) { 

              document.images[i].src = "calc001/dgbl.gif"

     } 

       document.evalform.honoff.value='on'

   }

   else{

     for (var i = 2; i < 13; i++) { 

              document.images[i].src = "calc001/calcbl.gif"

     } 

       document.evalform.honoff.value='off'

   }

 

}

</SCRIPT>

</head>

<BODY>

 

<img src="calc001/line2.gif" width=155 height=5><br>

<img src="calc001/left.gif" width=11 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/calcbl.gif" width=12 height=15><img src="calc001/right.gif" width=12 height=15><br><img src="calc001/line.gif" width=155 height=5><br>

<img alt="Calculator" src="calc001/main.gif" width=155 height=138 usemap="#Calc" border=0>

<MAP NAME="Calc">

<AREA SHAPE="rect" COORDS="4,6,36,22" HREF="JavaScript:onoff()">

<AREA SHAPE="rect" COORDS="43,6,73,22" HREF="JavaScript:visa('(')">

<AREA SHAPE="rect" COORDS="80,6,112,22" HREF="JavaScript:visa(')')">

<AREA SHAPE="rect" COORDS="119,6,151,22" HREF="JavaScript:visa('/')">

<AREA SHAPE="rect" COORDS="4,32,36,48" HREF="JavaScript:visa('7')">

<AREA SHAPE="rect" COORDS="43,32,73,48" HREF="JavaScript:visa('8')">

<AREA SHAPE="rect" COORDS="82,32,112,48" HREF="JavaScript:visa('9')">

<AREA SHAPE="rect" COORDS="119,32,151,48" HREF="JavaScript:visa('*')">

<AREA SHAPE="rect" COORDS="4,59,36,75" HREF="JavaScript:visa('4')">

<AREA SHAPE="rect" COORDS="43,59,73,75" HREF="JavaScript:visa('5')">

<AREA SHAPE="rect" COORDS="82,59,112,75" HREF="JavaScript:visa('6')">

<AREA SHAPE="rect" COORDS="119,59,151,75" HREF="JavaScript:visa('-')">

<AREA SHAPE="rect" COORDS="4,85,36,102" HREF="JavaScript:visa('1')">

<AREA SHAPE="rect" COORDS="43,85,73,102" HREF="JavaScript:visa('2')">

<AREA SHAPE="rect" COORDS="82,85,112,102" HREF="JavaScript:visa('3')">

<AREA SHAPE="rect" COORDS="119,85,151,102" HREF="JavaScript:visa('+')">

<AREA SHAPE="rect" COORDS="4,110,36,127" HREF="JavaScript:visa('0')">

<AREA SHAPE="rect" COORDS="43,110,73,127" HREF="JavaScript:visa('.')">

<AREA SHAPE="rect" COORDS="82,110,112,127" HREF="JavaScript:clear()">

<AREA SHAPE="rect" COORDS="119,110,151,127" HREF="JavaScript:compute()">

</MAP>

<FORM NAME="evalform">

<table>

<tr><td>输入计算公式为:</td><td> <INPUT TYPE=text NAME="expr" SIZE=23></td></tr>

<tr><td>计算结果为:</td><td><INPUT TYPE=text NAME="result" SIZE=23></td></tr>

</table>

<input type=hidden name=help>

<input type=hidden name=pos value=3>

<input type=hidden name=honoff value='off'>

</FORM>

 

0 Comments

Fri

20

Mar

2009

144、页面定时抖动

144、页面定时抖动

脚本说明:

第一步:把如下代码加入<body>区域中

<script LANGUAGE="JavaScript">

 

function init() {

setTimeout("shake(3)",1000);

// setTimeout("this.focus()",4000);

setTimeout("shake(3)",4100);

}

 

function shake(n) {

if (self.moveBy) {

for (i = 10; i > 0; i--) {

for (j = n; j > 0; j--) {

self.moveBy(0,i);

self.moveBy(i,0);

self.moveBy(0,-i);

self.moveBy(-i,0);

         }

      }

   }

 setTimeout("shake(5)", 5000);

}

 

</script>

 

<script language="JavaScript">

      <!-- begin

      var max=0;

      function textlist()

      {

      max=textlist.arguments.length;

      for (i=0; i<max; i++)

      this[i]=textlist.arguments[i];

      }

      tl=new textlist

      (

"李鹏会见安得拉邦首席部长奈杜",

"述评:发展新世纪睦邻友好合作关系",

"我国外汇储备已达一千六百五十六亿美元 ",

"人民日报18日社论:推进新的农业科技革命  ",

"“神舟二号”飞船轨道舱留轨继续进行空间科学探测试验",

"联合国证实贫铀弹含有铀-236",

"罗伯逊称北约将继续东扩",

"巴方指责以色列暗杀其高级官员 ",

"亚太议会论坛第九届年会在智利开幕",

"专电:布什宣誓就职典礼准备就绪",

"专电:布什宣誓就职典礼准备就绪 "

      );

      var x=0; pos=0;

      var l=tl[0].length;

      function textticker()

      {

        document.tickform.tickfield.value=tl[x].substring(0,pos)+"_";

        if(pos++==l)

              {

              pos=0;

              setTimeout("textticker()",1000);

              x++;

        if(x==max) x=0; l=tl[x].length;

              }

              else

        setTimeout("textticker()",50);

      }

      // end -->

      </script>

<form name="tickform"><input type=text name="tickfield" size=33></form>

 

 

第二步:把<body>中的内容改为:

<body bgcolor=#000000" onload="init();textticker()">

 

0 Comments

Fri

20

Mar

2009

143、计算存贮器

143、计算存贮器

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT language="JavaScript">

<!--

 

function random (maxValue)

 

{

day= new Date();

hour= day.getHours();

min=day.getMinutes();

sec=day.getSeconds();

mili=day.getTime()

return(((hour*3600)+(min*60)+(sec)+mili) % maxValue);

}

function ranom (maxValue)

//Calculates another random number

{

day= new Date();

mil=day.getTime();

return((mil) % maxValue);

}

 

//--

function add()

//function for addition

{

//If radiobutton 0 =checked then level, radiobutton 1-->level 2, else level 3

if(document.rekenen.arithmetic[0].checked)

maxValue=10

else

{if(document.rekenen.arithmetic[1].checked)

maxValue=30

else{

maxValue=60}}

//random numbers selected

numA=random(maxValue)

numB=ranom(maxValue)

 

numC=numA + numB

Answer=window.prompt(  numA + "+"  + numB +  " = ", 0);

if(window.confirm("你想看一下你回答的是否正确吗? " +numA+  " + " +numB ))

ans()

else{

alert("请过一会重新试一下!")

}

}

 

//--

function subtract()

//If radiobutton 0 =checked then level, radiobutton 1-->level 2, else level 3

{

if(document.rekenen.arithmetic[0].checked)

maxValue=10

else

{if(document.rekenen.arithmetic[1].checked)

maxValue=30

else{

maxValue=60}}

//random numbers selected

numA=random(maxValue)

numB=ranom(maxValue)

numC=numA - numB

Answer=window.prompt(  numA + "-"  + numB+  " = ", 0);

if(window.confirm("你想看一下你回答的是否正确吗?" +numA+  " - " +numB ))

ans()

else{

alert("请过一会重新试一下!")

}

}

 

 

 

//--

function devide()

//If radiobutton 0 =checked then level, radiobutton 1-->level 2, else level 3

{

if(document.rekenen.arithmetic[0].checked)

maxValue=10

else

{if(document.rekenen.arithmetic[1].checked)

maxValue=30

else{

maxValue=60}}

alert("请按四舍五入原则计算!")

//random numbers selected

numA=random(maxValue)+1;

numB=ranom(maxValue)+1;

numC=numA / numB;

numC=Math.round(numC)

Answer=window.prompt(  numA + "/"  + numB +  " = ", 0);

if(window.confirm("你想看一下你回答的是否正确吗? " +numA+  " / " +numB ))

ans()

else{

alert("请过一会重新试一下!")

}

}

 

 

//----

function multiply()

//If radiobutton 0 =checked then level, radiobutton 1-->level 2, else level 3

{

if(document.rekenen.arithmetic[0].checked)

maxValue=10

else

{if(document.rekenen.arithmetic[1].checked)

maxValue=30

else{

maxValue=60}}

//random numbers selected

numA=random(maxValue)

numB=ranom(maxValue)

numC=numA * numB

Answer=window.prompt(  numA + "*"  + numB +  " = ", 0);

if(window.confirm("你想看一下你回答的是否正确吗? " +numA+  " * " +numB ))

ans()

else{

alert("请过一会重新试一下!")

}

}

function score()

{

correct=0

wrong=0

}

function check()

{

alert("你的成绩\n "

+" : " +correct+ " 个答对了\n"

+"  : " +wrong+  " 个答错了 ")

}

//---

function ans()

{

 

if (Answer == numC)

{correct==correct++

alert("恭喜你,你回答对了.")}

else

 

{wrong==wrong++

alert("你的回答:  " +Answer+ "  是错误的."

+ " 正确的答案是:"

+ " = " +numC)}

}

//-->

</Script>

<font>

<Form Name="rekenen">

<INPUT type="button" value="加法" onClick="add()">

<INPUT type="button" value="减法" onClick="subtract()">

<INPUT type="button" value="乘法" onClick="multiply()">

<INPUT type="button" value="除法" onClick="devide()"><br>

<INPUT type="radio" name="arithmetic" >普通水平

<INPUT type="radio" name="arithmetic" checked>中等水平

<INPUT type="radio" name="arithmetic" >高级水平<br><p>

<INPUT type="button" value="查看成绩" onClick="check()">

<INPUT type="button" value="重新开始" onClick="score()">

</form></font>

 

 

 

第二步:把<body>区域中的内容为

<body bgColor=#fef4d9 onLoad="score()">

 

0 Comments

Fri

20

Mar

2009

142、整个页面任意移动

142、整个页面任意移动

脚本说明:

把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function moveWindowLeft() {

window.moveBy(-15, 0);

window.moveBy(0, 0);

}

function moveWindowRight() {

window.moveBy(15, 0);

window.moveBy(0, 0);

}

function moveWindowUp() {

window.moveBy(0, 0);

window.moveBy(0, -15);

}

function moveWindowDown() {

window.moveBy(0, 0);

window.moveBy(0, 15);

}

//  End -->

</script>

<center>

<form>

<table>

<tr>

<td>

</td>

<td>

<input type=button value="向上" onClick="moveWindowUp();">

</td>

<td>

</td>

</tr>

<tr>

<td>

<input type=button value="向左" onClick="moveWindowLeft();">

</td>

<td>

</td>

<td>

<input type=button value="向右" onClick="moveWindowRight();">

</td>

</tr>

<tr>

<td>

</td>

<td>

<input type=button value="向下" onClick="moveWindowDown();">

</td>

<td>

</td>

</tr>

</table>

</form>

</center>

 

0 Comments

Fri

20

Mar

2009

141、自动回答问题

141、自动回答问题

脚本说明:

把如下代码加入<body>区域中

<form>

<select name="selector">

<option value="我今年23">想知道我多大吗?

<option value="我在南京">想知道我在哪里吗?

<option value="http://www.javascript2000.com">想知道国内最大的javascript站点吗?

<option value="去网页制作特效站吧">不会做网页怎么办?

</select>

<INPUT TYPE="button" value="看答案" onClick="alert(form.selector.options[form.selector.selectedIndex].value)">

</form>

 

0 Comments

Fri

20

Mar

2009

140、访问次数统计

140、访问次数统计

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function getCookieVal (offset) {

var endstr = document.cookie.indexOf (";", offset);

if (endstr == -1)

endstr = document.cookie.length;

return unescape(document.cookie.substring(offset, endstr));

}

function GetCookie (name) {

var arg = name + "=";

var alen = arg.length;

var clen = document.cookie.length;

var i = 0;

while (i < clen) {

var j = i + alen;

if (document.cookie.substring(i, j) == arg)

return getCookieVal (j);

i = document.cookie.indexOf(" ", i) + 1;

if (i == 0)

break;

}

return null;

}

function SetCookie (name, value) {

var argv = SetCookie.arguments;

var argc = SetCookie.arguments.length;

var expires = (2 < argc) ? argv[2] : null;

var path = (3 < argc) ? argv[3] : null;

var domain = (4 < argc) ? argv[4] : null;

var secure = (5 < argc) ? argv[5] : false;

document.cookie = name + "=" + escape (value) +

((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +

((path == null) ? "" : ("; path=" + path)) +

((domain == null) ? "" : ("; domain=" + domain)) +

((secure == true) ? "; secure" : "");

}

function DisplayInfo() {

var expdate = new Date();

var visit;

expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));

if(!(visit = GetCookie("visit")))

visit = 0;

visit++;

SetCookie("visit", visit, expdate, "/", null, false);

var message;

if(visit == 1)

message="         Welcome to my page!";

if(visit== 2)

message="           I see you came back !";

if(visit == 3)

message="               Oh, it's you again!";

if(visit == 4)

message="            You must be curious!";

if(visit == 5)

message="      You're practically a regular!";

if(visit == 6)

message="              You need a hobby!";

if(visit == 7)

message="             Nothing better to do?";

if(visit == 8)

message="            Don't you ever sleep?";

if(visit == 9)

message="                      Get a life!!!";

if(visit >= 10)

message="  Rent is due on the 1st of the month!";

  alert("\n"+"你的浏览器已经访问过本页" + visit +"次了"+"\n"+"\n"+message);

}

function ResetCounts() {

var expdate = new Date();

expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));

visit = 0;

SetCookie("visit", visit, expdate , "/", null, false);

history.go(0);

}

// End -->

</Script>

<FORM>

<CENTER>

<INPUT NAME="update" TYPE="BUTTON" VALUE="查看次数" OnClick="history.go(0)">

<INPUT NAME="reset" TYPE="BUTTON" VALUE="重新计数" OnClick="ResetCounts()">

</CENTER>

</FORM>

 

 

第二步:把如下代码加入<body>区域中

<body bgcolor="#fef4d9" onload="DisplayInfo()">

 

0 Comments

Fri

20

Mar

2009

139、框中左右选择

139、框中左右选择

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

sortitems = 1;  // Automatically sort items within lists? (1 or 0)

 

function move(fbox,tbox) {

for(var i=0; i<fbox.options.length; i++) {

if(fbox.options[i].selected && fbox.options[i].value != "") {

var no = new Option();

no.value = fbox.options[i].value;

no.text = fbox.options[i].text;

tbox.options[tbox.options.length] = no;

fbox.options[i].value = "";

fbox.options[i].text = "";

   }

}

BumpUp(fbox);

if (sortitems) SortD(tbox);

}

function BumpUp(box)  {

for(var i=0; i<box.options.length; i++) {

if(box.options[i].value == "")  {

for(var j=i; j<box.options.length-1; j++)  {

box.options[j].value = box.options[j+1].value;

box.options[j].text = box.options[j+1].text;

}

var ln = i;

break;

   }

}

if(ln < box.options.length)  {

box.options.length -= 1;

BumpUp(box);

   }

}

 

function SortD(box)  {

var temp_opts = new Array();

var temp = new Object();

for(var i=0; i<box.options.length; i++)  {

temp_opts[i] = box.options[i];

}

for(var x=0; x<temp_opts.length-1; x++)  {

for(var y=(x+1); y<temp_opts.length; y++)  {

if(temp_opts[x].text > temp_opts[y].text)  {

temp = temp_opts[x].text;

temp_opts[x].text = temp_opts[y].text;

temp_opts[y].text = temp;

temp = temp_opts[x].value;

temp_opts[x].value = temp_opts[y].value;

temp_opts[y].value = temp;

      }

   }

}

for(var i=0; i<box.options.length; i++)  {

box.options[i].value = temp_opts[i].value;

box.options[i].text = temp_opts[i].text;

   }

}

// End -->

</script>

 

<form ACTION="" METHOD="POST">

<table border="0">

<tr>

<td><select multiple size="5" name="list1">

<option value="11"> item 1.1 </option>

<option value="12"> item 1.2 </option>

<option value="13"> item 1.3 </option>

</select></td>

<td>

<input type="button" value="   >>   " onclick="move(this.form.list1,this.form.list2)" name="B1"><br>

<input type="button" value="   <<   " onclick="move(this.form.list2,this.form.list1)" name="B2">

</td>

<td><select multiple size="5" name="list2">

<option value="21"> item 2.1 </option>

<option value="22"> item 2.2 </option>

<option value="23"> item 2.3 </option>

</select></td>

</tr>

</table>

</form>

 

0 Comments

Fri

20

Mar

2009

138、检测输入字符个数

138、检测输入字符个数

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function CountWords (this_field, alertWords, alertChars) {

if (alertWords == null) {

alertWords = true;

}

if (alertChars == null) {

alertChars = false;

}

var fullStr = this_field.value;

var charCount = fullStr.length;

var rExp = /[^A-Za-z0-9]/gi;

var spacesStr = fullStr.replace(rExp, " ");

var cleanedStr = spacesStr + " ";

do {

var old_str = cleanedStr;

cleanedStr = cleanedStr.replace("  ", " ");

} while(old_str != cleanedStr);

var splitString = cleanedStr.split(" ");

var wordCount = splitString.length -1;

if (fullStr.length <1) {

wordCount = 0;

}

if (wordCount == 1) {

wordOrWords = "个字";

}

else {

wordOrWords = "个字";

}

if (charCount == 1) {

charOrChars = "个字母";

} else {

charOrChars = "个字母";

}

if (alertWords & alertChars) {

alert ("计算结果:\n" + "   " + wordCount + wordOrWords + "\n" + "    " + charCount + charOrChars);

}

else {

if (alertWords) {

alert ("计算结果:  " + wordCount + wordOrWords);

}

else {

if (alertChars) {

alert ("计算结果:  " + charCount + charOrChars);

      }

   }

}

return wordCount;

}

//  End -->

</script>

<form>

<textarea cols=40 rows=5 name=x>

</textarea>

<br>

<input type=button value="计算字符" OnClick ="CountWords(this.form.x, true, true);">

</form>

 

0 Comments

Fri

20

Mar

2009

137、又一导航等待程序

137、又一导航等待程序

脚本说明:

把如下代码加入<body>区域中

<div id=process>LOADING</div>

<script>

var num=0;

function mypro()

{

num++;

myarray=new Array('#494949','#646464','#747474','#888888','#969696','#A8A8A8','#B6B6B6','#C6C6C6','#D7D7D7','#E1E1E1','#F0F0F0','#F9F9F9')

process.style.color=myarray[num-1]

process.innerText=process.innerText+'';

if(num<12) {setTimeout("mypro()",1000);}

else {window.open("http://www.7stk.com","new");}

}

mypro();

</script>

 

0 Comments

Fri

20

Mar

2009

136、鼠标点击效果

136、鼠标点击效果

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT>

 

function checkBrowserForVersion4(){

var x = navigator.appVersion;y = x.substring(0,4);

if (y>=4) setVariables();

}

 

function setVariables(){

if (navigator.appName == "Netscape"){h=".left=";v=".top=";dS="document.";sD=""; }

else{h=".pixelLeft=";v=".pixelTop=";dS="";sD=".style";}

 

objectX="object11";XX=-70;YY=-70;OB=11}

 

function setObject(a){objectX="object"+a;OB=a;XX=eval("xpos"+a);YY=eval("ypos"+a);}

function getObject(){if (isNav)document.captureEvents(Event.MOUSEMOVE);}

function releaseObject(){check="no";objectX="object11";document.close()}

function moveOB() {eval(dS+objectX+sD+h+Xpos);eval(dS+objectX+sD+v+Ypos);}

var isNav = (navigator.appName.indexOf("Netscape") !=-1)

var isIE = (navigator.appName.indexOf("Microsoft") !=-1)

check="no"

function MoveHandler(e) {Xpos = (isIE) ? event.clientX : e.pageX

Ypos = (isNav) ? e.pageY : event.clientY

if (check=="no"){

diffX=XX-Xpos;diffY=YY-Ypos;check="yes"

if (objectX=="object11")check="no"}

Xpos+=diffX;Ypos+=diffY

if (OB=="1")xpos1=Xpos,ypos1=Ypos

moveOB();}

if (isNav){

//the window or the document or the layer may capture mousemoves

document.captureEvents(Event.CLICK);document.captureEvents(Event.DBLCLICK);}

xpos1=330;ypos1=90;xpos11=-50;ypos11=-50;Xpos=5;Ypos=5

document.onmousemove = MoveHandler;document.onclick = getObject;

document.ondblclick = releaseObject;

 

</SCRIPT>

<DIV id=object1 style="LEFT: 330px; POSITION: absolute; TOP: 90px; Z-INDEX: 2">

<TABLE border=1 cellPadding=5>

  <TBODY>

  <TR>

    <TD bgColor=#eeeeee>

      <P align=center><A href="javascript:void(0)"

      onmousedown=setObject(1)>按了我只有双击才能甩掉<BR></A>www.7stk.com</P></TD></TR></TBODY></TABLE></DIV>

<DIV id=object11

style="LEFT: -70px; POSITION: absolute; TOP: -70px; Z-INDEX: 2"></DIV>

 

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload=checkBrowserForVersion4();>

 

0 Comments

Fri

20

Mar

2009

135、农历与公历对查工具

135、农历与公历对查工具

<HTML><HEAD><TITLE>农历与公历对查工具</TITLE>

<META

content="农历; 阳历; 月历; 节日; 时区; 节气; 八字; 干支; 生肖; gregorian solar; chinese lunar; calendar;"

name=keywords>

<META content=All name=robots>

<META content="gregorian solar calendar and chinese lunar calendar"

name=description>

<META content="text/html; charset=gb2312" http-equiv=Content-Type>

<center><font color=red size=6><b>农历与公历对查工具</b></font></center>

<SCRIPT language=JavaScript>

<!--

/*****************************************************************************

                                   日期资料

*****************************************************************************/

 

var lunarInfo=new Array(

0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2,

0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977,

0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970,

0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950,

0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557,

0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0,

0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0,

0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6,

0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570,

0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0,

0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5,

0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930,

0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530,

0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45,

0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0)

 

var solarMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);

var Gan=new Array("","","","","","","","","","");

var Zhi=new Array("","","","","","","","","","","","");

var Animals=new Array("","","","","","","","","","","","");

var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至")

var sTermInfo = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758)

var nStr1 = new Array('','','','','','','','','','','')

var nStr2 = new Array('','','廿','',' ')

var monthName = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");

 

//国历节日 *表示放假日

var sFtv = new Array(

"0101*元旦",

"0214 情人节",

"0303 我生日",

"0308 妇女节",

"0312 植树节",

"0315 消费者权益日",

"0317 St. Patrick's",

"0401 愚人节",

"0501 劳动节",

"0504 青年节",

"0512 护士节",

"0512 茵生日",

"0601 儿童节",

"0614 Flag Day",

"0701 建党节 香港回归纪念",

"0703 炎黄在线诞辰",

"0718 托普诞辰",

"0801 建军节",

"0808 父亲节",

"0909 毛泽东逝世纪念",

"0910 教师节",

"0928 孔子诞辰",

"1001*国庆节",

"1006 老人节",

"1024 联合国日",

"1111 Veteran's / Remembrance Day",

"1112 孙中山诞辰纪念",

"1220 澳门回归纪念",

"1225 Christmas Day",

"1226 毛泽东诞辰纪念")

 

//农历节日 *表示放假日

var lFtv = new Array(

"0101*春节",

"0115 元宵节",

"0505 端午节",

"0707 七夕情人节",

"0715 中元节",

"0815 中秋节",

"0909 重阳节",

"1208 腊八节",

"1224 小年",

"0100*除夕")

 

//某月的第几个星期几

var wFtv = new Array(

"0131 Martin Luther King Day",

"0231 President's Day",

"0520 母亲节",

"0530 Armed Forces Day",

"0531 Victoria Day",

"0716 合作节",

"0730 被奴役国家周",

"0811 Civic Holiday",

"0911 Labor Holiday",

"1021 Columbus Day",

"1144 Thanksgiving")

 

 

/*****************************************************************************

                                      日期计算

*****************************************************************************/

 

//====================================== 传回农历 y年的总天数

function lYearDays(y) {

   var i, sum = 348

   for(i=0x8000; i>0x8; i>>=1) sum += (lunarInfo[y-1900] & i)? 1: 0

   return(sum+leapDays(y))

}

 

//====================================== 传回农历 y年闰月的天数

function leapDays(y) {

   if(leapMonth(y))  return((lunarInfo[y-1900] & 0x10000)? 30: 29)

   else return(0)

}

 

//====================================== 传回农历 y年闰哪个月 1-12 , 没闰传回 0

function leapMonth(y) {

   return(lunarInfo[y-1900] & 0xf)

}

 

//====================================== 传回农历 ym月的总天数

function monthDays(y,m) {

   return( (lunarInfo[y-1900] & (0x10000>>m))? 30: 29 )

}

 

//====================================== 算出农历, 传入日期物件, 传回农历日期物件

//                                       该物件属性有 .year .month .day .isLeap .yearCyl .dayCyl .monCyl

function Lunar(objDate) {

 

   var i, leap=0, temp=0

   var baseDate = new Date(1900,0,31)

   var offset   = (objDate - baseDate)/86400000

 

   this.dayCyl = offset + 40

   this.monCyl = 14

 

   for(i=1900; i<2050 && offset>0; i++) {

      temp = lYearDays(i)

      offset -= temp

      this.monCyl += 12

   }

 

   if(offset<0) {

      offset += temp;

      i--;

      this.monCyl -= 12

   }

 

   this.year = i

   this.yearCyl = i-1864

 

   leap = leapMonth(i) //闰哪个月

   this.isLeap = false

 

   for(i=1; i<13 && offset>0; i++) {

      //闰月

      if(leap>0 && i==(leap+1) && this.isLeap==false)

         { --i; this.isLeap = true; temp = leapDays(this.year); }

      else

         { temp = monthDays(this.year, i); }

 

      //解除闰月

      if(this.isLeap==true && i==(leap+1)) this.isLeap = false

 

      offset -= temp

      if(this.isLeap == false) this.monCyl ++

   }

 

   if(offset==0 && leap>0 && i==leap+1)

      if(this.isLeap)

         { this.isLeap = false; }

      else

         { this.isLeap = true; --i; --this.monCyl;}

 

   if(offset<0){ offset += temp; --i; --this.monCyl; }

 

   this.month = i

   this.day = offset + 1

}

 

//==============================传回国历 y年某m+1月的天数

function solarDays(y,m) {

   if(m==1)

      return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28)

   else

      return(solarMonth[m])

}

//============================== 传入 offset 传回干支, 0=甲子

function cyclical(num) {

   return(Gan[num%10]+Zhi[num%12])

}

 

//============================== 月历属性

function calElement(sYear,sMonth,sDay,week,lYear,lMonth,lDay,isLeap,cYear,cMonth,cDay) {

 

      this.isToday    = false;

      //国历

      this.sYear      = sYear;

      this.sMonth     = sMonth;

      this.sDay       = sDay;

      this.week       = week;

      //农历

      this.lYear      = lYear;

      this.lMonth     = lMonth;

      this.lDay       = lDay;

      this.isLeap     = isLeap;

      //干支

      this.cYear      = cYear;

      this.cMonth     = cMonth;

      this.cDay       = cDay;

 

      this.color      = '';

 

      this.lunarFestival = ''; //农历节日

      this.solarFestival = ''; //国历节日

      this.solarTerms    = ''; //节气

 

}

 

//===== 某年的第n个节气为几日(0小寒起算)

function sTerm(y,n) {

   var offDate = new Date( ( 31556925974.7*(y-1900) + sTermInfo[n]*60000  ) + Date.UTC(1900,0,6,2,5) )

   return(offDate.getUTCDate())

}

 

//============================== 传回月历物件 (y,m+1)

function calendar(y,m) {

 

   var sDObj, lDObj, lY, lM, lD=1, lL, lX=0, tmp1, tmp2

   var lDPOS = new Array(3)

   var n = 0

   var firstLM = 0

 

   sDObj = new Date(y,m,1)            //当月一日日期

 

   this.length    = solarDays(y,m)    //国历当月天数

   this.firstWeek = sDObj.getDay()    //国历当月1日星期几

 

 

   for(var i=0;i<this.length;i++) {

 

      if(lD>lX) {

         sDObj = new Date(y,m,i+1)    //当月一日日期

         lDObj = new Lunar(sDObj)     //农历

         lY    = lDObj.year           //农历年

         lM    = lDObj.month          //农历月

         lD    = lDObj.day            //农历日

         lL    = lDObj.isLeap         //农历是否闰月

         lX    = lL? leapDays(lY): monthDays(lY,lM) //农历当月最後一天

 

         if(n==0) firstLM = lM

         lDPOS[n++] = i-lD+1

      }

 

      //sYear,sMonth,sDay,week,

      //lYear,lMonth,lDay,isLeap,

      //cYear,cMonth,cDay

      this[i] = new calElement(y, m+1, i+1, nStr1[(i+this.firstWeek)%7],

                               lY, lM, lD++, lL,

                               cyclical(lDObj.yearCyl) ,cyclical(lDObj.monCyl), cyclical(lDObj.dayCyl++) )

 

 

      if((i+this.firstWeek)%7==0)   this[i].color = 'red'  //周日颜色

      if((i+this.firstWeek)%14==13) this[i].color = 'red'  //周休二日颜色

   }

 

   //节气

   tmp1=sTerm(y,m*2  )-1

   tmp2=sTerm(y,m*2+1)-1

   this[tmp1].solarTerms = solarTerm[m*2]

   this[tmp2].solarTerms = solarTerm[m*2+1]

   if(m==3) this[tmp1].color = 'red' //清明颜色

 

   //国历节日

   for(i in sFtv)

      if(sFtv[i].match(/^(\d{2})(\d{2})([\s\*])(.+)$/))

         if(Number(RegExp.$1)==(m+1)) {

            this[Number(RegExp.$2)-1].solarFestival += RegExp.$4 + ' '

            if(RegExp.$3=='*') this[Number(RegExp.$2)-1].color = 'red'

         }

 

   //月周节日

   for(i in wFtv)

      if(wFtv[i].match(/^(\d{2})(\d)(\d)([\s\*])(.+)$/))

         if(Number(RegExp.$1)==(m+1)) {

            tmp1=Number(RegExp.$2)

            tmp2=Number(RegExp.$3)

            this[((this.firstWeek>tmp2)?7:0) + 7*(tmp1-1) + tmp2 - this.firstWeek].solarFestival += RegExp.$5 + ' '

         }

 

   //农历节日

   for(i in lFtv)

      if(lFtv[i].match(/^(\d{2})(.{2})([\s\*])(.+)$/)) {

         tmp1=Number(RegExp.$1)-firstLM

         if(tmp1==-11) tmp1=1

         if(tmp1 >=0 && tmp1<n) {

            tmp2 = lDPOS[tmp1] + Number(RegExp.$2) -1

            if( tmp2 >= 0 && tmp2<this.length) {

               this[tmp2].lunarFestival += RegExp.$4 + ' '

               if(RegExp.$3=='*') this[tmp2].color = 'red'

            }

         }

      }

 

   //黑色星期五

   if((this.firstWeek+12)%7==5)

      this[12].solarFestival += '黑色星期五 '

 

   //今日

   if(y==tY && m==tM) this[tD-1].isToday = true;

 

}

 

//====================== 中文日期

function cDay(d){

   var s;

 

   switch (d) {

      case 10:

         s = '初十'; break;

      case 20:

         s = '二十'; break;

         break;

      case 30:

         s = '三十'; break;

         break;

      default :

         s = nStr2[Math.floor(d/10)];

         s += nStr1[d%10];

   }

   return(s);

}

 

///////////////////////////////////////////////////////////////////////////////

 

var cld;

 

function drawCld(SY,SM) {

   var i,sD,s,size;

   cld = new calendar(SY,SM);

 

   if(SY>1874 && SY<1909) yDisplay = '光绪' + (((SY-1874)==1)?'':SY-1874)

   if(SY>1908 && SY<1912) yDisplay = '宣统' + (((SY-1908)==1)?'':SY-1908)

   if(SY>1911 && SY<1950) yDisplay = '民国' + (((SY-1911)==1)?'':SY-1911)

//   if(SY>1949) yDisplay = '共和国' + (((SY-1949)==1)?'':SY-1949)

 

  // GZ.innerHTML = yDisplay +' 农历' + cyclical(SY-1900+36) + '   '+Animals[(SY-4)%12]+'';

 

   if(SY>1949) yDisplay = ''

 

   GZ.innerHTML = yDisplay +' 农历' + cyclical(SY-1900+36) + '   '+Animals[(SY-4)%12]+'';

 

   YMBG.innerHTML = " " + SY + "<BR> " + monthName[SM];

 

 

   for(i=0;i<42;i++) {

 

      sObj=eval('SD'+ i);

      lObj=eval('LD'+ i);

 

      sObj.className = '';

 

      sD = i - cld.firstWeek;

 

      if(sD>-1 && sD<cld.length) { //日期内

         sObj.innerHTML = sD+1;

 

         if(cld[sD].isToday) sObj.className = 'todyaColor'; //今日颜色

 

         sObj.style.color = cld[sD].color; //国定假日颜色

 

         if(cld[sD].lDay==1) //显示农历月

            lObj.innerHTML = '<b>'+(cld[sD].isLeap?'':'') + cld[sD].lMonth + '' + (monthDays(cld[sD].lYear,cld[sD].lMonth)==29?'':'')+'</b>';

         else //显示农历日

            lObj.innerHTML = cDay(cld[sD].lDay);

 

         s=cld[sD].lunarFestival;

         if(s.length>0) { //农历节日

            if(s.length>6) s = s.substr(0, 4)+'…';

            s = s.fontcolor('red');

         }

         else { //国历节日

            s=cld[sD].solarFestival;

            if(s.length>0) {

               size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4;

               if(s.length>size+2) s = s.substr(0, size)+'…';

               s = s.fontcolor('blue');

            }

            else { //廿四节气

               s=cld[sD].solarTerms;

               if(s.length>0) s = s.fontcolor('limegreen');

            }

         }

         if(s.length>0) lObj.innerHTML = s;

 

      }

      else { //非日期

         sObj.innerHTML = '';

         lObj.innerHTML = '';

      }

   }

}

 

function changeLong()

{

var y,m,ly,lm,id,im,iy,yangy,yangm,deltm,miny,tt;

CLD.SY.selectedIndex=CLD.D1.selectedIndex;

CLD.SM.selectedIndex=CLD.D2.selectedIndex;

yangm=0;yangy=0;

tt=true;

while (tt)

       {

       yangm=0;yangy=0;

                     changeCld();

                 for(i=0;i<42;i++)

                 {

                    sD = i - cld.firstWeek;

                    if(sD>-1 && sD<cld.length)

                    { //日期内

                           if ((cld[sD].lMonth==CLD.D2.selectedIndex+1)&&(cld[sD].lYear==CLD.D1.selectedIndex+1900))

                           {

                                   yangy=CLD.SY.selectedIndex+1900;   yangm=CLD.SM.selectedIndex ;

                                   tt=false;

                                   break;

                                   }

                        }

                 }

                 if (!tt) break;

                

                     pushBtm('MD');

                     changeCld();

 

//                   alert(CLD.SY.selectedIndex+" "+CLD.SM.selectedIndex);

 

                 for(i=0;i<42;i++)

                 {

                    sD = i - cld.firstWeek;

                    if(sD>-1 && sD<cld.length)

                    { //日期内

                           if ((cld[sD].lMonth==CLD.D2.selectedIndex+1)&&(cld[sD].lYear==CLD.D1.selectedIndex+1900))

                           {

                                   yangy=CLD.SY.selectedIndex+1900;   yangm=CLD.SM.selectedIndex ;

                                   tt=false;

                                   break;

                                   }

                        }

                 }

                     break;              

       }

//            alert(yangy+" "+yangm);

      

 

//CLD.SY.selectedIndex=yangy;//-1900;

//pushBtm('YU');

//pushBtm('YD');

CLD.SM.selectedIndex=yangm;

pushBtm('MD');

pushBtm('MU');

     

            

     

}

//changeLong end

 

function changeCld() {

   var y,m;

   y=CLD.SY.selectedIndex+1900;

   m=CLD.SM.selectedIndex;

   drawCld(y,m);

}

 

function pushBtm(K) {

   switch (K){

      case 'YU' :

         if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;

         break;

      case 'YD' :

         if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;

         break;

      case 'MU' :

         if(CLD.SM.selectedIndex>0) {

            CLD.SM.selectedIndex--;

         }

         else {

            CLD.SM.selectedIndex=11;

            if(CLD.SY.selectedIndex>0) CLD.SY.selectedIndex--;

         }

         break;

      case 'MD' :

         if(CLD.SM.selectedIndex<11) {

            CLD.SM.selectedIndex++;

         }

         else {

            CLD.SM.selectedIndex=0;

            if(CLD.SY.selectedIndex<149) CLD.SY.selectedIndex++;

         }

         break;

      default :

         CLD.SY.selectedIndex=tY-1900;

         CLD.SM.selectedIndex=tM;

   }

   changeCld();

}

 

 

 

var Today = new Date();

var tY = Today.getFullYear();

var tM = Today.getMonth();

var tD = Today.getDate();

//////////////////////////////////////////////////////////////////////////////

 

var width = "130";

var offsetx = 2;

var offsety = 16;

 

var x = 0;

var y = 0;

var snow = 0;

var sw = 0;

var cnt = 0;

 

var dStyle;

document.onmousemove = mEvn;

 

//显示详细日期资料

function mOvr(v) {

   var s,festival;

   var sObj=eval('SD'+ v);

   var d=sObj.innerHTML-1;

 

      //sYear,sMonth,sDay,week,

      //lYear,lMonth,lDay,isLeap,

      //cYear,cMonth,cDay

 

   if(sObj.innerHTML!='') {

 

      sObj.style.cursor = 's-resize';

 

      if(cld[d].solarTerms == '' && cld[d].solarFestival == '' && cld[d].lunarFestival == '')

         festival = '';

      else

         festival = '<TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#CCFFCC"><TR><TD>'+

         '<FONT COLOR="#000000" STYLE="font-size:9pt;">'+cld[d].solarTerms + ' ' + cld[d].solarFestival + ' ' + cld[d].lunarFestival+'</FONT></TD>'+

         '</TR></TABLE>';

 

      s= '<TABLE WIDTH="130" BORDER=0 CELLPADDING="2" CELLSPACING=0 BGCOLOR="#000066"><TR><TD>' +

         '<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN="right"><FONT COLOR="#ffffff" STYLE="font-size:9pt;">'+

         cld[d].sYear+' '+cld[d].sMonth+' '+cld[d].sDay+' <br>星期'+cld[d].week+'<br>'+

         '<font color="violet">农历'+(cld[d].isLeap?' ':' ')+cld[d].lMonth+' '+cld[d].lDay+' </font><br>'+

         '<font color="yellow">'+cld[d].cYear+' '+cld[d].cMonth+' '+cld[d].cDay + '</font>'+

         '</FONT></TD></TR></TABLE>'+ festival +'</TD></TR></TABLE>';

 

 

      document.all["detail"].innerHTML = s;

 

     if (snow == 0) {

         dStyle.left = x+offsetx-(width/2);

         dStyle.top = y+offsety;

            dStyle.visibility = "visible";

            snow = 1;

     }

       }

}

 

//清除详细日期资料

function mOut() {

       if ( cnt >= 1 ) { sw = 0 }

       if ( sw == 0 ) { snow = 0;     dStyle.visibility = "hidden";}

       else cnt++;

}

 

//取得位置

function mEvn() {

   x=event.x;

   y=event.y;

       if (document.body.scrollLeft)

          {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}

       if (snow){

      dStyle.left = x+offsetx-(width/2)

      dStyle.top = y+offsety

       }

}

 

///////////////////////////////////////////////////////////////////////////

 

 

function tick() {

   var today

   today = new Date()

   Clock.innerHTML = today.toLocaleString().replace(/(|)/g, "/").replace(//, "");

//   Clock.innerHTML = TimeAdd(today.toGMTString(), CLD.TZ.value)

   window.setTimeout("tick()", 1000);

}

 

function setCookie(name, value) {

       var today = new Date()

       var expires = new Date()

       expires.setTime(today.getTime() + 1000*60*60*24*365)

       document.cookie = name + "=" + escape(value)   + "; expires=" + expires.toGMTString()

}

 

function getCookie(Name) {

   var search = Name + "="

   if(document.cookie.length > 0) {

      offset = document.cookie.indexOf(search)

      if(offset != -1) {

         offset += search.length

         end = document.cookie.indexOf(";", offset)

         if(end == -1) end = document.cookie.length

         return unescape(document.cookie.substring(offset, end))

      }

      else return ""

   }

}

 

/////////////////////////////////////////////////////////

 

function initial() {

   dStyle = detail.style;

   CLD.SY.selectedIndex=tY-1900;

   CLD.SM.selectedIndex=tM;

   drawCld(tY,tM);

 

//   CLD.TZ.selectedIndex=getCookie("TZ");

//   changeTZ();

   tick();

}

 

 

 

//-->

</SCRIPT>

 

<STYLE>.todyaColor {

       BACKGROUND-COLOR: aqua

}

</STYLE>

 

<META content="Microsoft FrontPage 6.0" name=GENERATOR></HEAD>

<BODY onload=initial()>

<SCRIPT language=JavaScript><!--

   if(navigator.appName == "Netscape" || parseInt(navigator.appVersion) < 4)

   document.write("<h1>你的浏览器无法执行此程序。</h1>此程序在 IE4 以后的版本才能执行!!")

//--></SCRIPT>

 

<DIV id=detail style="POSITION: absolute"></DIV>

<FORM name=CLD>

<div align="center">

<TABLE width="672" align="right" height="259" bordercolordark="#CC9900" border="4" background="l11.gif">

  <CENTER>

<center>

  <TBODY>

  </center></center>

  <TR>

  <TD align=middle vAlign=top width="170" height="255">

  <div align="center">

    <center>

  <TABLE BORDER=1 COLSPAN=2 width="221">

  <CENTER>

    <center><FONT size=2

      style="FONT-SIZE: 9pt">

    <td width="209">

      <p align="center"><font style="font-size:10.8pt" color=RED>本地计算机时间:</FONT></FONT><BR><FONT color=#000080 face=ARIAL

      id=Clock size=3 align="center"></FONT>

      <P><!--时区 *表示自动调整为日光节约时间-->

      </center>

   </CENTER>

   </TABLE>

  </center>

    </div>

    <div align="center">

      <center>

      <table border=1 height="1" width="16">

      <td height="1" width="255">

            <table width="212" height="1"><CENTER>

            <center>    

      <FONT id=tSave

      style="COLOR: red; FONT-FAMILY: Wingdings; FONT-SIZE: 18pt"></FONT>

      <td height="1" width="152"><font size="2"><FONT style="FONT-SIZE: 9pt">

      <font color="#0000FF">公历</font></font><FONT color=#ffffff  

            style="FONT-SIZE: 9pt"><SELECT name=SY onchange=changeCld()  

            style="FONT-SIZE: 9pt">  

              <SCRIPT language=JavaScript><!-- 

            for(i=1900;i<2050;i++) document.write('<option>'+i) 

            //--></SCRIPT> 

            </SELECT> </FONT><FONT color=#ffffff  

            style="FONT-SIZE: 9pt"><SELECT name=SM onchange=changeCld()  

            style="FONT-SIZE: 9pt">  

              <SCRIPT language=JavaScript><!-- 

            for(i=1;i<13;i++) document.write('<option>'+i) 

            //--></SCRIPT> 

            </SELECT></FONT></font>

      <P><font size="2"><FONT style="FONT-SIZE: 9pt"><font color="#0000FF">阴历</font></font><FONT color=#ffffff  

            style="FONT-SIZE: 9pt"><SELECT name=D1 onchange=changeLong()  

            style="FONT-SIZE: 9pt">  

              <SCRIPT language=JavaScript><!-- 

            for(i=1900;i<2050;i++) document.write('<option>'+i) 

            //--></SCRIPT> 

            </SELECT> </FONT><FONT color=#ffffff  

            style="FONT-SIZE: 9pt"><SELECT name=D2 onchange=changeLong()  

            style="FONT-SIZE: 9pt">  

              <SCRIPT language=JavaScript><!-- 

            for(i=1;i<13;i++) document.write('<option>'+i) 

            //--></SCRIPT> 

            </SELECT></FONT></font></P>

      <div align="center" style="width: 4; height: 1">

      </div>

      <td width="1" align="center" height="1">                                      

      <BUTTON onclick="pushBtm('MU')"  style="FONT-SIZE: 9pt">月↑</BUTTON>

      <BUTTON onclick="pushBtm('')" style="FONT-SIZE: 9pt">当月</BUTTON>              

      <BUTTON onclick="pushBtm('MD')"  style="FONT-SIZE: 9pt">月↓</BUTTON>                          

      </td>                                                                 

        </center></center>              

       <tr>              

              <CENTER>              

      <TD align=center vAlign=top width=152 height="1">                              

      <BUTTON onclick="pushBtm('YU')" style="FONT-SIZE: 9pt">年↑</BUTTON>                           

      <BUTTON onclick="pushBtm('YD')" style="FONT-SIZE: 9pt">年↓</BUTTON>                           

      </TD>                                   

        </center>                          

      <td colspan=2 width="46" height="1">                                  

          <p align="left"><INPUT onclick="javascript:window.close();" style="FONT-SIZE: 9pt" type=button value=关闭></p>                                 

      </td>                                 

                                       

       </table>                                                                                          

              <CENTER>                          

        <table border="1" width="100%" height="1" bordercolordark="#FFFFCC">                             

        <tr>                                             

          <td width="100%" height="1"><font style="font-size:10.8pt" color=#0>       

            阴历存在跨月情况,如果查找到的阴历月跨两个公历月,用<font color=blue>[月↑][月↓]</font>翻动可以找到你想要的确切日期。</font></td>             

        </tr>             

      </table>             

      </CENTER>             

      </table>             

      </center>      

    </div>      

    <TD align=middle width="423" height="255">                                                          

      <DIV style="position: absolute; top: 31; z-index: -1; left: 270; width: 347; height: 108">                                                                                             

        <p>                                                                                            

        <p>                                                                                            

        <p><FONT id=YMBG                                                                                                      

      style="COLOR: #f0f0f0; FONT-FAMILY: 'Arial Black'; FONT-SIZE: 20pt"> </FONT>                                                                                                     

      </DIV>                                                                                                    

      <div align="center">                                                                                                   

      <center>                                                                                                    

      <TABLE border=0 height="27" cellspacing="1">                                                                                                   

        <TBODY>                                                                                                   

        <TR>                                                                                                   

          <TD bgColor=#000080 colSpan=7 align="center" height="24"><FONT color=#000080 size=2                                                                                                    

            style="FONT-SIZE: 9pt"></FONT> <FONT color=#ffffff face=宋体 id=GZ                                                                                                   

            size=4></FONT><BR></TD></TR>                                                                                                 

        <TR align=middle bgColor=#e0e0e0>                                                                                                 

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                 

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                 

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                  

          <TD width=50 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                  

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                 

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD>                                                                                                 

          <TD width=54 height="1" align="center" bgcolor="#99CCFF"><font size="2"></font></TD></TR>                                                                                                  

        <SCRIPT language=JavaScript><!--                                                                                                 

            var gNum                                                                                                  

            for(i=0;i<6;i++) {                                                                                                 

               document.write('<tr align=center>')                                                                                                 

               for(j=0;j<7;j++) {                                                                                                 

                  gNum = i*7+j                                                                                                 

                  document.write('<td id="GD' + gNum +'" onMouseOver="mOvr(' + gNum +')" onMouseOut="mOut()"><font id="SD' + gNum +'" size=2 face="Arial Black"')                                                                                                 

                  if(j == 0) document.write(' color=red')                                                                                                  

                  if(j == 6)                                                                                                 

                     if(i%2==1) document.write(' color=red')                                                                                                  

                        else document.write(' color=green')                                                                                                 

                  document.write(' TITLE=""> </font><br><font id="LD' + gNum + '" size=2 style="font-size:9pt"> </font></td>')                                                                                                 

               }                                                                                                  

               document.write('</tr>')                                                                                                 

            }                                                                                                  

            //--></SCRIPT>                                                                                                 

        </TBODY></TABLE>                                                                                                  

      </center>                                                                                                 

      </div>                                                                                                 

  </TD>                                                                                                  

</TR></TBODY></TABLE>             

</div>             

</FORM>      

<p></p>    

</BODY></HTML>                                                                                                

 

 

0 Comments

Fri

20

Mar

2009

134、进入首页一个动态变化

134、进入首页一个动态变化

<SCRIPT language=JavaScript1.2 fptype="dynamicanimation">

<!--

       // See KB article about changing this dynamic HTML

       dynamicanimAttr = "dynamicanimation"

       animCancel = "skipanim"

       fpanimationPrefix = "fpAnim"

       animateElements = new Array()

       currentElement = 0

       speed = 1

       stepsZoom = 8

       stepsWord = 8

       stepsFly = 17

       stepsSpiral = 16

       stepsSpiralWord = 19

       stepsElastic = 32

       steps = stepsZoom

       step = 0

       cornerPhase=0

       outEffect=0

       function remSuffix(str)

       {

              ind=str.indexOf("FP")

              str = str.substring(0,ind)

              return str

       }

       function dynAnimOut(el)

       {

              outEffect=1

              dynAnimation(el)

              outEffect=0

       }

       function dynAnimation(obj)

       {

              animateElements = new Array()

              var ms = navigator.appVersion.indexOf("MSIE")

              ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)

              if(!ie4)

              {

                     if((navigator.appName == "Netscape") &&

                            (parseInt(navigator.appVersion.substring(0, 1)) >= 4))

                            doc_els=document.layers

                     else

                            return

              }

              else

                     doc_els=document.all

        if(outEffect && !ie4)

            return

              if(ie4)

              {

                  for (index=document.all.length-1; index >= document.body.sourceIndex; index--)

                     {

                            el = document.all[index]

                            if(outEffect && el != obj)

                                   continue

                            if(outEffect)

                                   animationId = el.id.substring(9,el.id.length)

                            else

                                   animationId = el.id.substring(6,el.id.length)

                            animation=remSuffix(animationId)

                            if(null != animation)

                            {

                                   altcnt=0

                                   if(    animation == "dropWord"                          ||

                                          animation == "flyTopRightWord"               ||

                                          animation == "flyBottomRightWord"          ||

                                          animation == "waveWords"                 ||

                                          animation == "hopWords")

                                   {

                                          ih = el.innerHTML

                                          outString = ""

                                          i1 = 0

                                          iend = ih.length

                                          while(true)

                                          {

                                                 i2 = startWord(ih, i1)

                                                 if(i2 == -1)

                                                 i2 = iend

                                                 outWord(ih, i1, i2, false, "", outEffect ? obj.id : el.id)

                                                 if(i2 == iend)

                                                        break

                                                 i1 = i2

                                                 i2 = endWord(ih, i1)

                                                 if(i2 == -1)

                                                        i2 = iend

                                                 if (animation == "waveWords")

                                                        outWordAlt(ih, i1, i2, true, animation, altcnt)

                                                 else

                                                        outWord(ih, i1, i2, true, (outEffect ? "Out" : "") + animation,

                                                               outEffect ?  obj.id : el.id)

 

                                                 if(i2 == iend)

                                                        break

                                                 i1 = i2

                                                 altcnt++

                                          }

                                          document.all[index].innerHTML = outString

                                          document.all[index].style.posLeft = 0

                                          document.all[index].setAttribute(animCancel, true)

                                          document.all[index].style.visibility="visible"

                                   }

                            }

                     }

              }

              i = 0

              for (index=0; index < doc_els.length; index++)

              {

                     el = doc_els[index]

                     if(0 != el.id.indexOf(fpanimationPrefix))

                            continue

                     if (ie4)

                     {

                            elprops=el.style

                            scrollOffsetTop=document.body.scrollTop

                            docHeight=document.body.offsetHeight

                            docWidth=document.body.offsetWidth

                            elW=100

                            elH=el.offsetHeight

                     }

                     else

                     {

                            elprops=el

                            scrollOffsetTop=window.pageYOffset

                            docHeight=window.innerHeight

                            docWidth=window.innerWidth

                            elW=el.clip.width

                            elH=el.clip.height

                     }

                     if(outEffect)

                            animationId = el.id.substring(9,el.id.length)

                     else

                            animationId = el.id.substring(6,el.id.length)

                     animation=remSuffix(animationId)

                     if(outEffect && (obj != el))

                     {

                            if(el.SRCID != obj.id)

                                   continue

                     }

                     if (null != animation )

                     {

                            if(ie4 && null!=el.getAttribute(animCancel, false))

                                   continue

                            if(!ie4)

                            {

                                   elprops.posLeft=elprops.left

                                   elprops.posTop=elprops.top

                            }

                            el.startL=offsetLeft(el)

                            if(animation == "flyLeft")

                            {

                                   elprops.posLeft = -offsetLeft(el)-elW

                                   elprops.posTop = 0

                            }

                            else if(animation == "flyRight" || animation=="elasticRight")

                            {

                                   elprops.posLeft = -offsetLeft(el)+docWidth

                                   elprops.posTop = 0

                            }

                            else if(animation == "flyTop" || animation == "dropWord")

                            {

                                   elprops.posLeft = 0

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)-elH

                            }

                            else if(animation == "flyBottom" || animation == "elasticBottom")

                            {

                                   elprops.posLeft = 0

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight

                            }

                            else if(animation == "flyTopLeft")

                            {

                                   elprops.posLeft = -offsetLeft(el)-elW

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)-elH

                            }

                            else if(animation == "flyTopRight" || animation == "flyTopRightWord")

                            {

                                   elprops.posLeft = -offsetLeft(el)+docWidth

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)-elH

                            }

                            else if(animation == "flyCorner")

                            {

                                   elprops.posLeft = docWidth*0.2-offsetLeft(el)

                                  

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight

                            }

                            else if(animation == "flyBottomLeft")

                            {

                                   elprops.posLeft = -offsetLeft(el)-elW

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight

                            }

                            else if(animation == "flyBottomRight" || animation == "flyBottomRightWord")

                            {

                                   elprops.posLeft = -offsetLeft(el)+docWidth

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight

                            }

                            else if(animation == "spiral")

                            {

                                   elprops.posLeft = -offsetLeft(el)+docWidth

                                   elprops.posTop = scrollOffsetTop-offsetTop(el)+docHeight

                            }

                            else if((animation.indexOf("waveWords") != -1) || animation=="hopWords")

                            {

                                   if(i)

                                   {

                                          prevEl=animateElements[i-1]

                                          elprops.r = offsetLeft(el)-prevEl.startL

                                   }

                                   else

                                          elprops.r = offsetLeft(el)

                            }

                            else if(animation == "wipeLR" || animation == "wipeMID")

                            {

                                   if (ie4 && elprops.position=="absolute")

                                   {

                                          el.sizeW=el.offsetWidth

                                          elprops.clip="rect(0 0 0 0)"

                                   }

                                   else if (!ie4)

                                   {

                                          el.sizeW=el.clip.width

                                          el.clip.width=0

                                   }

                            }

                            else if(animation == "wipeTB")

                            {

                                   if (ie4 && elprops.position=="absolute")

                                   {

                                          elprops.clip="rect(0 0 0 0)"

                                   }

                                   else if(!ie4)

                                   {

                                          el.sizeH=el.clip.height

                                          el.clip.height=0

                                   }

                            }

                            else if(animation == "zoomIn")

                            {

                                   elprops.posLeft = 0

                                   elprops.posTop = 0

                            }

                            else if(animation == "zoomOut")

                            {

                                   elprops.posLeft = 0

                                   elprops.posTop = 0

                            }

                            else

                            {

                                   continue

                            }

                            if(!outEffect)

                            {

                                   el.initLeft = elprops.posLeft

                                   el.initTop  = elprops.posTop

                                   el.endLeft  = 0

                                   el.endTop   = 0

                                   elprops.visibility = "hidden"

                            }

                            else

                            {

                                   el.initLeft = 0

                                   el.initTop  = 0

                                   el.endLeft = elprops.posLeft

                                   el.endTop  = elprops.posTop

                                   elprops.posTop = 0

                                   elprops.posLeft = 0

                            }

                            if(!ie4)

                            {

                                   elprops.left=elprops.initLeft

                                   elprops.top =elprops.initTop

                            }

                            animateElements[i++] = el

                     }

              }

              if(animateElements.length > 0)

              {

                     if(outEffect)

                            window.setTimeout("animate(1);", speed, "Javascript")

                     else

                            window.setTimeout("animate(0);", speed, "Javascript")

              }

       }

       function offsetLeft(el)

       {

              if(ie4)

              {

                     x = el.offsetLeft

                     for (e = el.offsetParent; e; e = e.offsetParent)

                            x += e.offsetLeft

                     return x

              }

              else

              {

                     x = el.pageX

                     return x

              }

       }

       function offsetTop(el)

       {

              if(ie4)

              {

                     y = el.offsetTop

                     for (e = el.offsetParent; e; e = e.offsetParent)

                            y += e.offsetTop;

                     return y

              }

              else

              {

                     y = el.pageY

                     return y  

              }

       }

       function startWord(ih, i)

       {

              for(tag = false; i < ih.length; i++)

              {

                     c = ih.charAt(i)

                     if(c == '<')

                     {

                            if(ih.substring(i+1, i+4) == "IMG")

                            return i;

                            tag = true

                     }

                     if(!tag)

                            return i

                     if(c == '>')

                            tag = false

              }

              return -1

       }

       function endWord(ih, i)

       {

              nonSpace = false

              space = false

              img = false

              if(ih.charAt(i) == '<')

              {

                     img = true

                     i++;

              }

              while(i < ih.length)

              {

                     c = ih.charAt(i)

                     if(c != ' ')

                            nonSpace = true

                     if(img && c == '>')

                            img = false;

                     if(nonSpace && !img && c == ' ')

                            space = true

                     if(c == '<')

                            return i

                     if(space && c != ' ')

                            return i

                     i++

              }

              return -1

       }

       function outWord(ih, i1, i2, dyn, anim, srcID)

       {

              if(dyn)

                     if(!outEffect)

                            outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "FP\" style=\"position: relative; visibility: hidden;\">"

                     else

                            outString += "<SPAN SRCID=\"" + srcID + "\"ID=\"" +  fpanimationPrefix + anim + "FP\" style=\"position: relative;\">"

              outString += ih.substring(i1, i2)

              if(dyn)

                     outString += "</SPAN>"

       }

       function outWordAlt(ih, i1, i2, dyn, anim, altcnt)

       {

              if(dyn)

              {

                     if(altcnt%2)

                            outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "LFP\" style=\"position: relative;  visibility: hidden;\">"

                     else

                            outString += "<SPAN ID=\"" +  fpanimationPrefix + anim + "RFP\" style=\"position: relative;  visibility: hidden;\">"

              }

                    

              outString += ih.substring(i1, i2)

              if(dyn)

                     outString += "</SPAN>"

       }

       function animate(animOut)

       {

              el = animateElements[currentElement]

              if(animOut)

                     animationId = el.id.substring(9,el.id.length);

              else

                     animationId = el.id.substring(6,el.id.length);

              animation=remSuffix(animationId)

              if (ie4)

                     elprops=el.style

              else

                     elprops=el

 

              if(!step && !animOut)

                     elprops.visibility="visible"

              step++

              if(animation == "spiral")

              {

                     steps = stepsSpiral

                     v = step/steps

                     rf = 1.0 - v

                     t = v * 2.0*Math.PI

                     rx = Math.max(Math.abs(el.initLeft), 200)

                     ry = Math.max(Math.abs(el.initTop),  200)

                     elprops.posLeft = Math.ceil(-rf*Math.cos(t)*rx)

                     elprops.posTop  = Math.ceil(-rf*Math.sin(t)*ry)

              }

              else if(animation == "waveWordsL" || animation=="hopWords" || animation == "waveWords")

              {

                     steps = stepsSpiralWord

                     v = step/steps

                     rf = (1.0 - v)

                     t = v * 1.0*Math.PI

                     elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)

                     elprops.posTop  = Math.ceil(-rf*Math.sin(t)*elprops.r)

              }

              else if(animation == "waveWordsR")

              {

                     steps = stepsSpiralWord

                     v = step/steps

                     rf = (1.0 - v)

                     t = v * 1.0*Math.PI

                     elprops.posLeft = Math.ceil(-rf*Math.cos(t)*elprops.r)

                     elprops.posTop  = Math.ceil( rf*Math.sin(t)*elprops.r)

              }

              else if(animation == "zoomIn")

              {

                     steps = stepsZoom

                     elprops.fontSize = Math.ceil(50+50*step/steps) + "%"

                     elprops.posLeft = 0

              }

              else if(animation == "zoomOut")

              {

                     steps = stepsZoom

                     fontSz=Math.ceil(100+200*(steps-step)/steps) + "%"

                     elprops.fontSize = fontSz

                     elprops.posLeft = 0

              }

              else if(animation == "elasticRight")

              {

                     steps = stepsElastic

                     v = step/steps

                     rf=Math.exp(-v*7)

                     t = v * 1.5*Math.PI

                     rx =Math.abs(el.initLeft)

                     elprops.posLeft = rf*Math.cos(t)*rx

                     elprops.posTop  = 0

              }

              else if(animation == "elasticBottom")

              {

                     steps = stepsElastic

                     v = step/steps

                     rf=Math.exp(-v*7)

                     t = v * 2.5*Math.PI

                     ry =Math.abs(el.initTop)

                     elprops.posLeft = 0

                     elprops.posTop  = rf*Math.cos(t)*ry

              }

              else if(animation == "wipeLR")

              {

                     steps = stepsElastic

                     if(ie4 && elprops.position=="absolute")

                            elprops.clip = "rect(0 "+ step/steps*100 +"% 100% 0)"

                     else if (!ie4)

                     {

                            elprops.clip.right=step/steps*el.sizeW

                     }

              }

              else if(animation == "wipeTB")

              {

                     steps = stepsElastic

                     if(ie4 && elprops.position=="absolute")

                            elprops.clip = "rect(0 100% "+step/steps*el.offsetHeight+"px 0)"

                     else

                            elprops.clip.bottom=step/steps*el.sizeH

              }

              else if(animation == "wipeMID")

              {

                     steps = stepsElastic

                     if(ie4 && elprops.position=="absolute")

                     {

                            elprops.clip = "rect(0 "+el.sizeW/2*(1+step/steps)+"px 100% "+el.sizeW/2*(1-step/steps)+")"

                     }

                     else if(!ie4)

                     {

                            elprops.clip.right=el.sizeW/2*(1+step/steps)

                            elprops.clip.left=el.sizeW/2*(1-step/steps)

                     }

              }

              else if(animation == "flyCorner")

              {

                     if(!cornerPhase)

                     {

                            steps = stepsElastic/2

                            v = step/steps

                            rf=Math.exp(-v*7)

                            t = v * 2.5*Math.PI

                            ry =Math.abs(el.initTop)

                            elprops.posTop  = rf*Math.cos(t)*ry

                     }

                     else

                     {

                            steps = stepsFly

                            dl = el.initLeft / steps

                            elprops.posLeft = elprops.posLeft - dl

                            elprops.posTop = 0

                     }

              }

              else

              {

                     steps = stepsFly

                     if(animation == "dropWord" || animation == "flyTopRightWord" || animation == "flyBottomRightWord")

                            steps = stepsWord

                     dl = (el.endLeft - el.initLeft) / steps

                     dt = (el.endTop  - el.initTop)  / steps

                     elprops.posLeft = elprops.posLeft + dl

                     elprops.posTop = elprops.posTop + dt

              }

              if (step >= steps)

              {

                     if(!(animation == "wipeLR"  ||

                            animation  == "wipeTB"      ||

                            animation  == "wipeMID"   ||

                            (animation == "flyCorner" && !cornerPhase)))

                     {

                            elprops.posLeft = el.endLeft

                            elprops.posTop = el.endTop

                     }

                     if(animOut)

                     {

                            elprops.visibility="hidden"

                     }

 

                     step = 0

                     if(animation=="flyCorner" && !cornerPhase)

                            cornerPhase=1

                     else

                     {

                            cornerPhase=0

                            currentElement++

                     }

 

              }

              if(!ie4)

              {

                     elprops.left=elprops.posLeft

                     elprops.top =elprops.posTop

              }

              if(currentElement < animateElements.length)

              {

                     if(animOut)

                            window.setTimeout("animate(1);", speed, "Javascript")

                     else

                            window.setTimeout("animate(0);", speed, "Javascript")

              }

              else

                     currentElement=0

       }

       function rollIn(el)

       {

              var ms = navigator.appVersion.indexOf("MSIE")

              ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)

              if(ie4)

              {

                     el.initstyle=el.style.cssText;el.style.cssText=el.fprolloverstyle

              }

       }

       function rollOut(el)

       {

              var ms = navigator.appVersion.indexOf("MSIE")

              ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)

              if(ie4)

              {

                     el.style.cssText=el.initstyle

              }

       }

       function clickSwapStyle(el)

       {

              var ms = navigator.appVersion.indexOf("MSIE")

              ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)

              if(ie4)

              {

                     ts=el.style.cssText

                     el.style.cssText=el.fprolloverstyle

                     el.fprolloverstyle=ts

              }

       }

       function clickSwapImg(el)

       {

        if(document.all || document.layers)

        {

                  ts=el.src

                  el.src=el.lowsrc

                  el.lowsrc=ts

        }

       }

//-->

 

 

 

</SCRIPT>

<BODY bgcolor=blue onload=dynAnimation()>

<P></P>

<P> </P>

<P> </P>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

  <TBODY>

  <TR>

    <TD width="20%"></TD>

    <TD width="80%">

      <P language=Javascript1.2 id=fpAnimflyLeftFP1

      style="VISIBILITY: hidden; LETTER-SPACING: 3px; POSITION: relative! important"

      dynamicanimation="fpAnimflyLeftFP1"><FONT face=Arial color=#ffffff><SPAN

      style="LETTER-SPACING: 3px">http://www.7stk.com</SPAN></FONT></P></TD></TR></TBODY></TABLE></CENTER></DIV>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

  <TBODY>

  <TR>

    <TD width="100%">

      <P language=Javascript1.2 id=fpAnimflyLeftFP2

      style="VISIBILITY: hidden; POSITION: relative! important" align=center

      dynamicanimation="fpAnimflyLeftFP2"><IMG height=1 alt="line.gif (118 字节)"

      src="line.gif"

width=550></P></TD></TR></TBODY></TABLE></CENTER></DIV>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

  <TBODY>

  <TR>

    <TD width="38%">

      <P language=Javascript1.2 id=fpAnimflyLeftFP3

      style="VISIBILITY: hidden; POSITION: relative! important" align=right

      dynamicanimation="fpAnimflyLeftFP3"><IMG height=53

      src="wta.gif" width=171></P></TD>

    <TD width="62%">

      <P language=Javascript1.2 id=fpAnimflyRightFP1

      style="VISIBILITY: hidden; POSITION: relative! important"

      dynamicanimation="fpAnimflyRightFP1"><IMG height=53 

      src="456.gif"

width=320></P></TD></TR></TBODY></TABLE></CENTER></DIV>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>

  <TBODY>

  <TR>

    <TD width="100%">

      <P language=Javascript1.2 id=fpAnimflyRightFP2

      style="VISIBILITY: hidden; POSITION: relative! important" align=center

      dynamicanimation="fpAnimflyRightFP2"><IMG height=1

      src="line.gif"

width=550></P></TD></TR></TBODY></TABLE></CENTER></DIV>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="79%" border=0>

  <TBODY>

  <TR>

    <TD width="44%">

      <P language=Javascript1.2 id=fpAnimflyBottomFP1

      style="VISIBILITY: hidden; POSITION: relative! important" align=right

      dynamicanimation="fpAnimflyBottomFP1"><IMG height=106 alt=威特实业

      src="wtd.gif" width=115></P></TD>

    <TD width="3%">

      <P language=Javascript1.2 id=fpAnimflyBottomFP2

      style="VISIBILITY: hidden; LINE-HEIGHT: 20px; POSITION: relative! important"

      dynamicanimation="fpAnimflyBottomFP2"></P></TD>

    <TD width="53%"><SPAN style="FONT-SIZE: 9pt"><FONT color=#ffffff>

      <P language=Javascript1.2 id=fpAnimspiralFP1

      style="VISIBILITY: hidden; LINE-HEIGHT: 20px; POSITION: relative! important"

      dynamicanimation="fpAnimspiralFP1">地址:北京万网服务中心<BR></FONT></SPAN><FONT

      color=#ffffff><SPAN

      style="FONT-SIZE: 9pt">*********版权所有<BR>QQ58856743<BR>站务联系: contact@1stscript.com</SPAN></FONT></P></TD></TR></TBODY></TABLE></CENTER></DIV>

<P> </P><P> </P>

<DIV align=center>

<CENTER>

<TABLE cellSpacing=0 cellPadding=0 width="87%" border=0>

  <TBODY>

  <TR>

    <TD width="100%">

      <P language=Javascript1.2 id=fpAnimzoomInFP1

      style="VISIBILITY: hidden; POSITION: relative! important" align=right

      dynamicanimation="fpAnimzoomInFP1"><A

      href="http://www.7stk.com"><FONT color=#ffffff><SPAN

      style="FONT-SIZE: 9pt">点此进入>></SPAN></FONT></A></P></TD></TR></TBODY></TABLE></CENTER></DIV>

 

 

0 Comments

Fri

20

Mar

2009

133、函数计算】

133、函数计算】

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

var a, b, c;

function xtop(form) {

form.u.value = (form.b.value * -1) / (form.a.value * 2);

}

function ytop(form) {

form.u2.value = -1 * (form.b.value * form.b.value) / (4 * form.a.value) - (-1 * form.c.value);

}

function doCoord(form) {

form.co.value = form.u.value + "," + form.u2.value;

}

function disc(form) {

form.o.value = (form.b.value * form.b.value) - (form.a.value * form.c.value * 4);

}

function zeroes1(form) {

form.n.value = ((form.b.value * -1) - (Math.sqrt(form.o.value))) / (form.a.value * 2);

}

function zeroes2(form) {

form.n2.value = ((form.b.value * -1) - (-1 * Math.sqrt(form.o.value))) / (form.a.value * 2);

}

function move_in(img_name,img_src) {

document[img_name].src=img_src;

}

//  End -->

</script>

<form>

<table bgcolor="#C0C0C0" cellspacing=2 cellpadding=2 border=3>

<tr>

<td>

<b>

<h3>Parabolic Calculator</h3>

<input name="a" size="3">X<sup>2</sup>+

<input name="b" size="3">X +

<input name="c" size="3">

<br>

<input type="button" value="x-top" name="x-top" onclick="xtop(this.form)">

<input type="button" value="y-top" name="y-top" onclick="ytop(this.form)">

<input type="button" value="crd" name="crd" onclick="doCoord(this.form)">

<input type="button" value="disc." name="D" onclick="disc(this.form)">

<br>

<input type="button" value="0-points" name="zeroes" onclick="zeroes1(this.form);zeroes2(this.form)">

<input type="button" onclick="xtop(this.form);ytop(this.form);doCoord(this.form);disc(this.form);zeroes1(this.form);zeroes2(this.form)" value="do all">

<input type="button" name="pics" value="show e.g." onClick="if(form.a.value>0 && form.o.value>0)move_in('p','p2.gif');if (form.a.value<0 && form.o.value>0)move_in('p','p3.gif'); if(form.a.value>0 && form.o.value==0) move_in('p','p4.gif'); if(form.a.value<0 && form.o.value==0) move_in('p','p5.gif'); if(form.a.value>0 && form.o.value<0) move_in('p','p6.gif'); if(form.a.value<0 && form.o.value<0) move_in('p','p7.gif')" value="show e.g.">

<br>

<input type="text" name="u" size="8"> x-top<br>

<input type="text" name="u2" size="8"> y-top<br>

<input type="text" size="8" name="co" onmouseover="form.rem.value=form.co.value"> Coord.<br>

<input type="text" size="8" name="o"> Discriminant<br>

<input type="text" size="8" name="n"> neg zero pt.<br>

<input type="text" size="8" name="n2"> pos zero pt.

<input type="hidden" value="" name="rem"><br>

<input type="reset" value="reset"><br>

</b>

</td>

<td><img src="p1.gif" width=200 name="p" height=200 border=0 alt=""></td>

</tr>

</table>

</form>

 

0 Comments

Fri

20

Mar

2009

132、时间警告器

132、时间警告器

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT language=JavaScript>

set = null

var timerID = null

var timerRunning = false

function stopclock() {

 if(timerRunning)

 clearTimeout(timerID)

 timerRunning = false

}

function startclock() {

 stopclock()

 showtime()

}

function showtime(){

 var now = new Date()

 var hours = now.getHours()

 var minutes = now.getMinutes()

 var seconds = now.getSeconds()

 var timeValue = "" + ((hours > 12) ? hours - 12 : hours)

 timeValue += ((minutes < 10) ? ":0" : ":") + minutes

 timeValue += ((seconds < 10) ? ":0" : ":") + seconds

 timeValue += (hours >= 12) ? " PM" : " AM"

 document.alert.time.value = timeValue

 if(timeValue == set) {alert(message);}

 timerID = setTimeout("showtime()",1000)

 timerRunning = true

}

function setalert() {

 set = prompt("设置警告时间\n请输入标准格式的时间---0:00:00 AM/PM .\n例如: 11:01:00 AM \n ","");

 document.alert.set.value = set

 setmess()

}

function setmess() {

 message = prompt("设置警告信息\n 如:别忘了你上网已经快一个小时了.","");

 document.alert.message.value = message

}

function about() {

 alert("时间警告器\n (webmaster@javascript2000.com) [http://1stscript.com]");

}

function quit() {

 if(confirm("确定吗?还是多呆一会吧...")) {

 about()

 close()

}

}

</SCRIPT>

<FORM name=alert>

<TABLE  border="3" cellpadding="2" cellspacing="0">

<TBODY>

<TR>

              <TD ><b>现在时间 - </b></TD>

<TD>

<INPUT name=time size=10 value="00:00 ?M">

</TD>

</TR>

<TR>

              <TD ><b>警告时间 - </b></TD>

<TD>

<INPUT name=set size=10 value="00:00 AM">

</TD>

</TR>

<TR>

              <TD ><b>警告信息 - </b></TD>

<TD>

<INPUT name=message size=30 value=None>

</TD>

</TR>

<TR>

<TD>

<INPUT onclick=setalert() type=button value="设置警告时间">

</TD>

<TD>

<INPUT onclick=setmess() type=button value="设置警告信息">

</TD>

</TR>

<TR>

<TD>

<INPUT onclick=about() type=button value=关于>

</TD>

<TD>

<INPUT onclick=quit() type=button value=退出>

</TD>

</TR>

</TBODY>

</TABLE>

</FORM>

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload=startclock(); >

 

 

0 Comments

Fri

20

Mar

2009

130、综合的按钮

130、综合的按钮

脚本说明:

把如下代码加入<body>区域中

<style type="text/css">

#divExCont {position:absolute; left:0px; top:0px; clip:rect(0,0,0,0); layer-background-color:#ffffff; background-color:#ffffff}

#divCircle {position:absolute; z-index:500; visibility:hidden; width:170px;}

body       {background-color:#000000; overflow:hidden;}

</style>

<script language="JavaScript" type="text/javascript">

function lib_bwcheck(){ //Browsercheck (needed)

       this.ver=navigator.appVersion

       this.agent=navigator.userAgent

       this.dom=document.getElementById?1:0

       this.opera5=this.agent.indexOf("Opera 5")>-1

       this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;

       this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

       this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

       this.ie=this.ie4||this.ie5||this.ie6

       this.mac=this.agent.indexOf("Mac")>-1

       this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;

       this.ns4=(document.layers && !this.dom)?1:0;

       this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

       return this

}

var bw=new lib_bwcheck()

 

 

/*** Variables to set ***/

sCircleWidth = 168 //The width the script will clip to

sCircleHeight = 168       //The height the script will clip to

sStarty = 200         //Where do you want it to initially start

sStartx = 200         //Where do you want it to initially start

clipSpeed = 20              //Number of pixels for each step in the animation.

 

/******************************************************************************

Making the clipobject part

******************************************************************************/  

function makeObj(obj, nest, x, y){

       nest = (!nest) ? "":'document.'+nest+'.';                                                                

     this.css = bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;         

       this.evnt = bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;                                                                                     

       this.clip = b_clip;

       this.clipIt = b_clipIt;

       this.clipTo = b_clipTo;

       this.obj = obj + "Object";

       eval(this.obj + "=this");

       return this;

}

//clip part

function b_clipTo(t,r,b,l){

       if (bw.ns4){

              this.css.clip.top=t;this.css.clip.right=r;this.css.clip.bottom=b;this.css.clip.left=l;

       }

       else {

              this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";

       }

}

function b_clipIt(tstop,rstop,bstop,lstop,step,fn){

       if (!fn) fn = null

       var clipval = new Array()

       if (bw.dom || bw.ie4) {

              clipval = this.css.clip

              clipval = clipval.slice(5,clipval.length-1);

              clipval = clipval.split(' ')

              for (var i=0; i<4; i++) clipval[i] = parseInt(clipval[i])

       }

       else {

              clipval[0] = this.css.clip.top

           clipval[1] = this.css.clip.right

           clipval[2] = this.css.clip.bottom

           clipval[3] = this.css.clip.left

       }

       totantstep = Math.max(Math.max(Math.abs((tstop-clipval[0])/step),Math.abs((rstop-clipval[1])/step)),

              Math.max(Math.abs((bstop-clipval[2])/step),Math.abs((lstop-clipval[3])/step)))

       if (!this.clipactive)

              this.clip(clipval[0],clipval[1],clipval[2],clipval[3],(tstop-clipval[0])/totantstep,

                     (rstop-clipval[1])/totantstep,(bstop-clipval[2])/totantstep,

                            (lstop-clipval[3])/totantstep,totantstep,0, fn)

}

function b_clip(tcurr,rcurr,bcurr,lcurr,tperstep,rperstep,bperstep,lperstep,totantstep,antstep, fn){

       tcurr=tcurr+tperstep; rcurr=rcurr+rperstep

       bcurr=bcurr+bperstep; lcurr=lcurr+lperstep

       this.clipTo(tcurr,rcurr,bcurr,lcurr)

       if(antstep<totantstep){

              this.clipactive=true

              antstep++

              setTimeout(this.obj+".clip("+tcurr+","+rcurr+","+bcurr+","+lcurr+","+tperstep+","

                     +rperstep+","+bperstep+","+lperstep+","+totantstep+","+antstep+",'"+fn+"')", 40)  

       }else{

              this.clipactive = false

              eval(fn)

       }

}

/******************************************************************************

Initiating the page and the clip objects.

******************************************************************************/  

function spotInit(){

       pageWidth = (bw.ns4 || bw.ns6)?innerWidth:document.body.clientWidth;

       pageHeight = (bw.ns4 || bw.ns6)?innerHeight:document.body.clientHeight;

       oExCont = new makeObj('divExCont')

       if (bw.dom || bw.ie4){

              oExCont.css.width = pageWidth

              oExCont.css.height = pageHeight

       }

       oCircle = new makeObj('divCircle','divExCont')

       oExCont.clipTo(sStarty,sStartx+sCircleWidth,sStarty+sCircleHeight,sStartx)

       oCircle.css.left = sStartx

       oCircle.css.top = sStarty

       oCircle.css.visibility = "visible"

       if (bw.ns4)document.captureEvents(Event.MOUSEMOVE)

       document.onmousemove = moveCircle;

}

function moveCircle(e){

       x = (bw.ns4 || bw.ns6)?e.pageX:event.x

       y = (bw.ns4 || bw.ns6)?e.pageY:event.y

       oExCont.clipTo(y-sCircleHeight/2, x+sCircleWidth/2, y+sCircleHeight/2, x-sCircleWidth/2)

       oCircle.css.left = x-sCircleWidth/2

       oCircle.css.top = y-sCircleHeight/2

}

//This is being called when someone clicks the circle.

function showCont(){

       document.onmousemove = null

       oCircle.css.visibility = "hidden"

       oCircle.css.left = 0

       oCircle.css.top = 0

       oExCont.clipIt(-clipSpeed, pageWidth+clipSpeed, pageHeight+clipSpeed, -clipSpeed, clipSpeed, 'oExCont.css.overflow="auto"')

}

 

if (bw.bw) onload = spotInit

</script>

 

<div id="divExCont">

<div id="divCircle"><a href="#" onclick="showCont(); return false" onfocus="if(this.blur)this.blur()"><img src="spotlight_circle.gif" width="170" height="170" alt="" border="0"></a></div>

 

0 Comments

Fri

20

Mar

2009

129、图片变形展开效果

129、图片变形展开效果

脚本说明:

第一步:把如下代码加入<body>区域中:

<script>

// blink speed in miliseconds

var rate = 333;

 

// true to start automatically, else false

var DoIt = true

 

// the three blink colors

var Color1 = "#FF0000"

var Color2 = "#00FF00"

var Color3 = "#0000FF"

 

// the color if/when turned off

var ColorX = "#C0C0C0"

 

var i = 0;

function doTriStateRainbow(){

   if (document.all){

      if (DoIt){

         i++;

         if (i==1) C = Color1

         if (i==2) C = Color2

         if (i==3) C = Color3

         document.body.style.scrollbarBaseColor = C

         if (i>2) i=0;

         timer=setTimeout('doTriStateRainbow()', rate)

      }else{

         document.body.style.scrollbarBaseColor = ColorX 

      }

   }  

}

 

</script>

 

<a href="#" onClick="DoIt=false">Off</a>

<a href="#" onClick="DoIt=true;doTriStateRainbow()">On</a> 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onload="doTriStateRainbow()">

 

0 Comments

Fri

20

Mar

2009

128、不同用户登陆转换

128、不同用户登陆转换

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

<!--

function update(n) {

    var what;

    if (document.getElementById) what = document.getElementById('myForm').elements;

    else if (document.all)       what = document.all['myTab'].myForm.elements;

    else if (document.layers)    what = document.layers['myTab'].document.myForm.elements;

 

    for (var i=0, j=what.length; i<j; i++) {

        var myType = (what[i].type).toLowerCase(), myName = what[i].name;

        if (myType == 'radio' && what[i].checked)

            document.hiddenForm.elements[myName].value = what[i].value;

        if (myType == 'checkbox')

            document.hiddenForm.elements[myName].value = ((what[i].checked) ? what[i].value : '');

        if (myType == 'password' || myType == 'text' || myType == 'textarea')

            document.hiddenForm.elements[myName].value = what[i].value;

        if (myType == 'select-one')

            document.hiddenForm.elements[myName].value = what[i].options[what[i].selectedIndex].text;

    }

}

 

var theCountries = ['美国','中国','加拿大'];

var theAges      = ['0 - 17','16 - 21','22 - 30','30 - 45','45 - 60','60+'];

var theSkills    = ['Java','JavaScript','VBScript','ASP','HTML'];

 

function show(n) {

    var output = '<form name="myForm">';

    switch(n) {

        case 1:

            // This demonstrates text and password fields

            output += '\n<p>姓名:<br>';

            output += '\n<input type="text" name="myName" value="' + document.hiddenForm.myName.value + '" size="30">';

            output += '\n<p>Mail地址:<br>';

            output += '\n<input type="text" name="myEmail" value="' + document.hiddenForm.myEmail.value + '" size="30">';

            output += '\n<p>用户编号:<br>';

            output += '\n<input type="text" name="myUserid" value="' + document.hiddenForm.myUserid.value + '" size="30">';

            output += '\n<p>密码:<br>';

            output += '\n<input type="password" name="myPassword" value="' + document.hiddenForm.myPassword.value + '" size="30">';

            break;

        case 2:

            // This demonstrates more text fields and a select form field

            output += '\n<p>地址一:<br>';

            output += '\n<input type="text" name="myAddress1" value="' + document.hiddenForm.myAddress1.value + '" size="30">';

            output += '\n<p>地址二:<br>';

            output += '\n<input type="text" name="myAddress2" value="' + document.hiddenForm.myAddress2.value + '" size="30">';

            output += '\n<p>地址三:<br>';

            output += '\n<input type="text" name="myAddress3" value="' + document.hiddenForm.myAddress3.value + '" size="30">';

            output += '\n<p>国家:';

            output += '\n<br><select name="myCountry">';

            for (var i=0; i<theCountries.length; i++) {

                if (document.hiddenForm.myCountry.value == theCountries[i])

                    output += '\n<option selected>' + theCountries[i];

                else

                    output += '\n<option>' + theCountries[i];

            }

            output += '\n<\/select>';

            break;

        case 3:

            // This demonstrates radio form fields

            output += '\n<p>年龄:';

            for (var i=0; i<theAges.length; i++) {

                if (document.hiddenForm.myAge.value == theAges[i])

                    output += '\n<br><input checked type="radio" name="myAge" value="' + theAges[i] + '"> ' + theAges[i];

                else

                    output += '\n<br><input type="radio" name="myAge" value="' + theAges[i] + '"> ' + theAges[i];

            }

            break;

        case 4:

            // This demonstrates check box form fields

            output += '\n<p>精通软件:'

            for (var i=0; i<theSkills.length; i++) {

                if (document.hiddenForm.elements[theSkills[i]].value == 'on')

                    output += '\n<br><input checked type="checkbox" name="' + theSkills[i] + '"> - ' + theSkills[i];

                else

                    output += '\n<br><input type="checkbox" name="' + theSkills[i] + '"> - ' + theSkills[i];

            }

            break;

 

    }

    output += '\n<\/form>';

 

    if (document.getElementById) {

        if (window.HTMLElement) {

            spanNode = document.getElementById('myTab');

            while (spanNode.hasChildNodes()) spanNode.removeChild(spanNode.lastChild);

            var range = document.createRange();

            range.selectNodeContents(spanNode);

            spanNode.appendChild(range.createContextualFragment(output));

        }

        else {

            document.all('myTab').innerHTML = output;

        }

    }

    else if (document.all)

        document.all('myTab').innerHTML = output;

    else if (document.layers) {

        document.layers['myTab'].document.open();

        document.layers['myTab'].document.writeln(output);

        document.layers['myTab'].document.close();

    }

}

//--></script>

<form name="hiddenForm" method="get" action="mailto:webmaster@k688.com">

<input type="hidden" value="" name="myName">

<input type="hidden" value="" name="myEmail">

<input type="hidden" value="" name="myUserid">

<input type="hidden" value="" name="myPassword">

 

<input type="hidden" value="" name="myAddress1">

<input type="hidden" value="" name="myAddress2">

<input type="hidden" value="" name="myAddress3">

<input type="hidden" value="0" name="myCountry">

 

<input type="hidden" value="" name="myAge">

 

<input type="hidden" value="" name="Java">

<input type="hidden" value="" name="JavaScript">

<input type="hidden" value="" name="VBScript">

<input type="hidden" value="" name="ASP">

<input type="hidden" value="" name="HTML">

 

<input type="button" value="姓名"     onClick="update(tab);show(tab=1)">

<input type="button" value="地址"  onClick="update(tab);show(tab=2)">

<input type="button" value="年龄"      onClick="update(tab);show(tab=3)">

<input type="button" value="精通技艺"   onClick="update(tab);show(tab=4)">

<input type="submit" value="发送">

</form>

 

<span id="myTab" style="position:relative"></span>

 

第二步:把<body>中的内容改为:

<body  onLoad="if (document.getElementById || document.all || document.layers) show(tab=1)">

 

0 Comments

Fri

20

Mar

2009

127、编程时文件上传

127、编程时文件上传

脚本说明:

把如下代码加入<body>区域中:

<DIV id=jh0

style="FONT-SIZE: 32pt; FILTER: shadow(color=gray,direction=270) alpha(opacity=50); VISIBILITY: hidden; WIDTH: 250px; COLOR: yellow; POSITION: absolute; TOP: 100px"><IMG

src="xiao-x.gif"></DIV>

<DIV id=jh1

style="FONT-SIZE: 16px; FILTER: glow(color=#0000ff,strength=1) shadow(color=gray,direction=90) alpha(opacity=50); VISIBILITY: hidden; WIDTH: 200px; COLOR: #aaaaff; POSITION: absolute; TOP: 160px">

</DIV>

<DIV id=jh2

style="FILTER: revealtrans(duration=2,transition=23); LEFT: 150px; VISIBILITY: hidden; POSITION: absolute; TOP: 130px"></div>

<SCRIPT language=javascript>

function Start(){s=1;t=100;jh0.style.visibility="visible";jh1.style.visibility="visible";Move1();}

function Move1(){jh0.style.left=s;jh1.style.left=600-s;s+=4;if(s<260)setTimeout("Move1()",50);else{s=1;jh0.style.filter="shadow(color=gray,direction=180) alpha(opacity=50)";jh1.style.filter="glow(color=#0000ff,strength=1) shadow(color=gray,direction=180) alpha(opacity=50)";Move2();}}

function Move2(){jh0.style.top=t-s;jh1.style.top=t+60-s;s+=3;if(s<60)setTimeout("Move2()",100);else{jh2.style.visibility="visible";if(jh2.filters(0).status!=2){jh2.filters(0).Apply();jh2.filters(0).Play();}jh0.style.filter="shadow(color=gray,direction=135) alpha(opacity=50)";jh1.style.filter="glow(color=#0000ff,strength=1) shadow(color=gray,direction=135) alpha(opacity=50)";}}

Start()

</SCRIPT>

 

0 Comments

Fri

20

Mar

2009

126、页面中的MIDI播放器

126、页面中的MIDI播放器

脚本说明:

把如下代码加入<body>区域中

<embed height=25 src=1.mid type=audio/x-pn-realaudio-plugin width=200 autostart="false" controls="PlayButton"></embed>

 

0 Comments

Fri

20

Mar

2009

125、背景音乐选择

125、背景音乐选择

脚本说明:

把如下代码加入<body>区域中

<BGSOUND SRC="" LOOP=-1 ID=BgSound>

<SELECT NAME="select" onchange="BgSound.src=this.value">

<OPTION VALUE="" SELECTED>请选择播放音乐</OPTION>

<OPTION VALUE="1.mid">仙俭音乐1</OPTION>

<OPTION VALUE="2.mid">仙俭音乐2</OPTION>

<OPTION VALUE="3.mid">仙俭音乐3</OPTION>

<OPTION VALUE=4.mid">仙俭音乐4</OPTION>

<OPTION VALUE="5.mid">仙俭音乐5</OPTION>

<OPTION VALUE="6.mid">大日子</OPTION>

<OPTION VALUE="7.mid">失忆周末</OPTION>

<OPTION VALUE="8.mid">无忌</OPTION>

<OPTION>[暂止播放]</OPTION>

</SELECT>

 

0 Comments

Fri

20

Mar

2009

124、行走的小人

124、行走的小人

脚本说明:

第一步:把如下代码加入<body>区域中

<script language="JavaScript">

<!--

loc=0

move=2

var xx

function setDistance(r){

clearTimeout(xx)

move=r

if (move!=0)moveBody()

}

b=20

function moveBody(){

loc+=move

       for (k=1;k<7;k++){

       bod="bod"+k;

       if (document.all){eval(bod+".style.left="+(b+loc))}

       if (document.layers){eval("document."+bod+".left="+(b+loc));}

       }

setCircle()

legL()

legR()

 

xx=setTimeout("moveBody()",20)

}

 

pX=20;pY=60

obs = new Array(13)

function ob () {

for (i=0; i<13; i++) {

       if (document.all) obs[i]=new Array (eval('ob'+i).style,-100,-100)

       else obs[i] = new Array (eval('document.ob'+i),-100,-100)

       }

}

 

function showDots() {

       for (i=0; i<7; i++) {

              obs[i][0].left=obs[i][1]+pX

              obs[i][0].top=obs[i][2]+pY

       }

  for (i=7; i<13; i++) {

              obs[i][0].left=obs[i][1]+pX

              obs[i][0].top=obs[i][2]+pY-30

       }

 

}

 

c=1

var xL=33

function legL() {

xL+=c

 

              for (m=4;m<7;m++) {

                     obs[m][1] = Math.sin(Math.PI*xL/30) * (33 - (m-4)*11)+loc;

                     obs[m][2] = -Math.cos(Math.PI*xL/30) * (33 - (m-4)*11);

              }

       for (i=10;i<13;i++) {

                     obs[i][1] = Math.sin(Math.PI*xL/30) * (33 - (i-10)*11)+loc;

                     obs[i][2] = -Math.cos(Math.PI*xL/30) * (33 - (i-10)*11);

              }

 

}

xR=27

 

function legR() {

 

xR-=c

if (xR==25) c-=2

if (xR==35) c+=2

              for (i=1;i<4;i++) {

                     obs[i][1]=Math.sin(Math.PI*xR/30)*(33-(i-1)*11)+loc;

                     obs[i][2]=-Math.cos(Math.PI*xR/30)*(33-(i-1)*11);

              }

              for (i=7;i<10;i++) {

                     obs[i][1]=Math.sin(Math.PI*xR/30)*(33 - (i-7)*11)+loc;

                     obs[i][2]=-Math.cos(Math.PI*xR/30)*(33 - (i-7)*11);

              }

}

 

//head

var dot=9

rads=new Array(9)

function rad () {

for (i=1; i<dot; i++) {

       if (document.all) rads[i]=new Array (eval('rad'+i).style,-100,-100)

       else rads[i] = new Array (eval('document.rad'+i),-100,-100)

       }

setRad()

}

 

function setCircle() {

       for (o=1; o<dot; o++) {

              rads[o][0].left=rads[o][1]+20+loc

              rads[o][0].top=rads[o][2]

       }

}

 

 

function setRad() {

              for (i=1; i<dot; i++) {

              rads[i][1] = Math.sin(Math.PI*(i/((dot-1)/2)))*10;

              rads[i][2] = -Math.cos(Math.PI*(i/((dot-1)/2)))*10;

              }

setCircle()

}

//-->

</script>

<div id="text" style="position:absolute;left:320;top:200;z-index:8">

  <a HREF="javascript:setDistance(2)">向前走</a> <a HREF="javascript:setDistance(-2)">向后走</a>

  <a HREF="javascript:setDistance(0)">停止</a>

</div>

<div id="bod1" style="position:absolute;left:20;top:20;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="bod2" style="position:absolute;left:20;top:30;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="bod3" style="position:absolute;left:20;top:40;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="bod4" style="position:absolute;left:20;top:50;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="bod5" style="position:absolute;left:20;top:60;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="bod6" style="position:absolute;left:25;top:15;z-index:8">

  <font SIZE="-5" COLOR="#0080C0"><b> o</b></font>

</div>

<div id="ob0" style="position:absolute;left:-20;top:-20;z-index:1">

  

</div>

<div id="ob1" style="position:absolute;left:-20;top:-20;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>._</b></font>

</div>

<div id="ob2" style="position:absolute;left:-20;top:-20;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="ob3" style="position:absolute;left:-20;top:-20;z-index:8">

  <font SIZE="+3" COLOR="#0000FF"><b>.</b></font>

</div>

<div id="ob4" style="position:absolute;left:-20;top:-20;z-index:8">

  <font SIZE="+3" COLOR="#00ffFF"><b>._</b></font>

</div>

<div id="ob5" style="position:absolute;left:-20;top:-20;z-index:8">

  <font SIZE="+3" COLOR="#00ffff"><b>.</b></font>

</div>

<div id="ob6" style="position:absolute;left:-20;top:-20;z-index:7">

  <font SIZE="+3" COLOR="#00ffff"><b>.</b></font>

</div>

<div id="ob7" style="position:absolute;left:-20;top:-20;z-index:7">

  <font SIZE="+3" COLOR="#00ffff"><b>.</b></font>

</div>

<div id="ob8" style="position:absolute;left:-20;top:-20;z-index:7">

  <font SIZE="+3" COLOR="#00ffff"><b>.</b></font>

</div>

<div id="ob9" style="position:absolute;left:-20;top:-20;z-index:7">

  <font SIZE="+3" COLOR="#00ffff"><b>.</b></font>

</div>

<div id="ob10" style="position:absolute;left:-20;top:-20;z-index:9">

  <font SIZE="+3" COLOR="#ff0000"><b>.</b></font>

</div>

<div id="ob11" style="position:absolute;left:-20;top:-20;z-index:9">

  <font SIZE="+3" COLOR="#FF0000"><b>.</b></font>

</div>

<div id="ob12" style="position:absolute;left:-20;top:-20;z-index:9">

  <font SIZE="+3" COLOR="#FF0000"><b>.</b></font>

</div>

<div id="rad0" class="num" style="position:absolute;left:-20;top:-20;z-index:1">

  

</div>

<div id="rad1" class="num" style="position:absolute;left:-20;top:-20;z-index:8">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad2" class="num" style="position:absolute;left:-20;top:-20;z-index:8">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad3" class="num" style="position:absolute;left:-20;top:-20;z-index:8">

  <font color="#000000" size="2"><b><br>

  -</b></font>

</div>

<div id="rad4" class="num" style="position:absolute;left:-20;top:-20;z-index:8">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad5" class="num" style="position:absolute;left:-20;top:-20;z-index:8">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad6" class="num" style="position:absolute;left:-20;top:-20;z-index:7">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad7" class="num" style="position:absolute;left:-20;top:-20;z-index:7">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="rad8" class="num" style="position:absolute;left:-20;top:-20;z-index:7">

  <font color="#000000" size="+3"><b>.</b></font>

</div>

<div id="note" style="position:absolute; left:20px; top:150px;">

  <font color="#000000"><b><br>

  </b></font>

</div>

 

 

第二步:把<body>中的内容改为:

<body bgcolor="#fef4d9" onLoad="rad();ob();setInterval('showDots()',10);moveBody()">

 

0 Comments

Fri

20

Mar

2009

123、极酷的文字效果

123、极酷的文字效果

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT LANGUAGE="JavaScript">

<!-- Beginning of JavaScript -

 

 

var timer

function initiate() {

    mytext1.Rotate(0,0,10)

    mytext2.Rotate(0,0,-10)

    mytext3.Rotate(0,5,0)

       mytext4.Rotate(0,5,5)

    timer=setTimeout("initiate()",20)

}

-->

</SCRIPT>

<OBJECT ID="mytext1"

CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6"

STYLE="POSITION:absolute;TOP:0px;LEFT:200px;WIDTH:300;HEIGHT:300">

<PARAM NAME="Line0001" VALUE="SetFillColor(0,0,255)">

<PARAM NAME="Line0002" VALUE="SetFont('돋움',

60, 700, 0, 0, 0)">

<PARAM NAME="Line0003" VALUE="Text('光临', 0, 0, 0)">

</OBJECT> <OBJECT ID="mytext2"

CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6"

STYLE="POSITION:absolute;TOP:0px;LEFT:200px;WIDTH:300;HEIGHT:300;">

<PARAM NAME="Line0001" VALUE="SetFillColor(255,0,0)">

<PARAM NAME="Line0002" VALUE="SetFont('돋움',

40, 700, 0, 0, 0)">

<PARAM NAME="Line0003" VALUE="Text('欢迎', 0, 0, 0)">

</OBJECT> <OBJECT ID="mytext3"

CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6"

STYLE="POSITION:absolute;TOP:0px;LEFT:0px;WIDTH:600;HEIGHT:300;">

<PARAM NAME="Line0001" VALUE="SetFillColor(255,255,255)">

<PARAM NAME="Line0002" VALUE="SetFont('돋움',

24, 700, 0, 0, 0)">

<PARAM NAME="Line0003" VALUE="Text('http://www.7stk.com', 0, 0, 0)">

</OBJECT>

<OBJECT ID="mytext4"

CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6"

STYLE="POSITION:absolute;TOP:0px;LEFT:0px;WIDTH:600;HEIGHT:300;">

<PARAM NAME="Line0001" VALUE="SetFillColor(255,111,255)">

<PARAM NAME="Line0002" VALUE="SetFont('.ff7;',

60, 700, 0, 0, 0)">

<PARAM NAME="Line0003" VALUE="Text('网页特效代码', 0, 0, 0)">

</OBJECT>

 

第二步:把<body>中的内容改为:

<body onLoad="initiate()">

 

0 Comments

Fri

20

Mar

2009

122、IP地址的显示(要有后台程序支持)

122IP地址的显示(要有后台程序支持)

脚本说明:

把如下代码加入<body>区域中:

<script language="javascript">

 

 

var ip = '<!--#echo var="REMOTE_ADDR"-->'

 

function ipval() {

document.myform.ipaddr.value=ip;

}

window.onload=ipval

</script>

 

<form method="post" action="" name="myform">

  <input type="text" name="ipaddr" readonly>

</form>

 

0 Comments

Fri

20

Mar

2009

121、 asf文件在线播放

121 asf文件在线播放

脚本说明:

把如下代码加入<body>区域中

<object classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95     codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=7.0   height=53 id=NSPlay0 name=NSPlay type=application/x-oleobject                   width=87 VIEWASTEXT  standby="Loading Microsoft Windows Media Player components..." border="0"><param name="AudioStream" value="-1">                                                                       

                          <param name="AutoSize" value="0">                                                                       

                          <param name="AutoStart" value="0">                                                                       

                          <param name="AnimationAtStart" value="-1">                                                                       

                          <param name="AllowScan" value="-1">                                                                       

                          <param name="AllowChangeDisplaySize" value="-1">                                                                       

                          <param name="AutoRewind" value="0">                                                                        

                          <param name="Balance" value="0">                                                                       

                          <param name="BaseURL" value>                                                                        

                          <param name="BufferingTime" value="10">                                                                       

                          <param name="CaptioningID" value>                                                                        

                          <param name="ClickToPlay" value="-1">                                                                       

                          <param name="CursorType" value="0">                                                                        

                          <param name="CurrentPosition" value="-1">                                                                       

                          <param name="CurrentMarker" value="0">                                                                        

                          <param name="DefaultFrame" value>                                                                       

                          <param name="DisplayBackColor" value="0">                                                                       

                          <param name="DisplayForeColor" value="65280">                                                                       

                          <param name="DisplayMode" value="0">                                                                       

                          <param name="DisplaySize" value="1">                                                                       

                          <param name="Enabled" value="-1">                                                                       

                          <param name="EnableContextMenu" value="-1">                                                                        

                          <param name="EnablePositionControls" value="-1">                                                                       

                          <param name="EnableFullScreenControls" value="-1">                                                                        

                          <param name="EnableTracker" value="-1">                                                                       

                          <param name="Filename" value="http://www.shunde.net.cn/~biyun/wlsd/down/yin/zheng/asf/5.asf">                                                                       

                          <param name="InvokeURLs" value="-1">                                                                       

                          <param name="Language" value="-1">                                                                       

                          <param name="Mute" value="0">                                                                        

                          <param name="PlayCount" value="1">                                                                       

                          <param name="PreviewMode" value="0">                                                                        

                          <param name="Rate" value="1">                                                                       

                          <param name="SAMILang" value>                                                                        

                          <param name="SAMIStyle" value>                                                                       

                          <param name="SAMIFileName" value>                                                                        

                          <param name="SelectionStart" value="-1">                                                                       

                          <param name="SelectionEnd" value="-1">                                                                        

                          <param name="SendOpenStateChangeEvents" value="-1">                                                                       

                          <param name="SendWarningEvents" value="-1">                                                                       

                          <param name="SendErrorEvents" value="-1">                                                                       

                          <param name="SendKeyboardEvents" value="0">                                                                       

                          <param name="SendMouseClickEvents" value="0">                                                                       

                          <param name="SendMouseMoveEvents" value="0">                                                                       

                          <param name="SendPlayStateChangeEvents" value="-1">                                                                        

                          <param name="ShowCaptioning" value="0">                                                                       

                          <param name="ShowControls" value="-1">                                                                        

                          <param name="ShowAudioControls" value="0">                                                                       

                          <param name="ShowDisplay" value="0">                                                                        

                          <param name="ShowGotoBar" value="0">                                                                       

                          <param name="ShowPositionControls" value="-1">                                                                       

                          <param name="ShowStatusBar" value="-1">                                                                       

                          <param name="ShowTracker" value="-1">                                                                       

                          <param name="TransparentAtStart" value="-1">                                                                       

                          <param name="VideoBorderWidth" value="0">                                                                       

                          <param name="VideoBorderColor" value="0">                                                                        

                          <param name="VideoBorder3D" value="-1">                                                                       

                          <param name="Volume" value="0">                                                                        

                          <param name="WindowlessVideo" value="0">                                                                                                                                                               

                        </object>

 

0 Comments