Mon

02

Mar

2009

60、标题栏栏闪烁

60、标题栏栏闪烁

脚本说明:

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

<script language="JavaScript">

step=0

function flash_title()

    {

      step++

      if (step==3) {step=1}

      if (step==1) {document.title='☆★网络编程站★☆ —— www.7stk.com'}

      if (step==2) {document.title='★☆网络编程站☆★ —— www.7stk.com'}

      setTimeout("flash_title()",380);

    }

flash_title()

</script>

 

0 Comments

Mon

02

Mar

2009

59、标题栏显示链接路径

59、标题栏显示链接路径

脚本说明:

把如下代码加入区域中

<script language="JavaScript1.2">

 

if (document.all||document.getElementById){

var thetitle=document.title

document.title=''

}

 

 

var data="0123456789";

 

var done=1;

function statusIn(text){

decrypt(text,2,1);

}

 

function statusOut(){

self.status='';

done=1;

}

 

 

 

function decrypt(text, max, delay){

if (done){

done = 0;

decrypt_helper(text, max, delay, 0, max);

}

 

}

 

function decrypt_helper(text, runs_left, delay, charvar, max){

if (!done){

runs_left = runs_left - 1;

var status = text.substring(0,charvar);

for(var current_char = charvar; current_char < text.length; current_char++){

status += data.charAt(Math.round(Math.random()*data.length));

}

document.title = status;

var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"

var new_char = charvar + 1;

var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"

if(runs_left > 0){

setTimeout(rerun, delay);

}

else{

if (charvar < text.length){

setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));

}

else

{

done = 1;

}

}

}

}

 

//if IE 4+ or NS 6+

if (document.all||document.getElementById)

statusIn(thetitle)

</script>

0 Comments

Mon

02

Mar

2009

58、状态栏循环文字

58、状态栏循环文字

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function mklist(n)

{

  this.length=n;

  for (var c=1 ; c <= n ; c++) {

    this[c]=0;

  }

  return this;

}

 

function browserdelay()

{

  var retval=500;

  if (navigator.userAgent.indexOf("Win") != 0) {

    retval=150;

  }

  else if (navigator.userAgent.indexOf("Mac") != 0) {

    retval=500;

  }

  else if (navigator.userAgent.indexOf("X11") != 0) {

    retval=750;

  }

  return retval;

}

 

function mkcfg(n)

{

  this.num=1;

  this.seed=0;

  this.list=new mklist(n);

  this.type=new mklist(n);

  this.delay=browserdelay();

  this.timer=0;

  this.showurl=(5 * 1000);

  this.looping=true;

  this.msgdisp=(4 * 1000);

  this.barwidth=100;

  return this;

}

 

function urlfix(obj)

{

  window.clearTimeout(window.config.timer);

  window.defaultStatus=obj.href;

  window.config.timer=window.setTimeout("sbprint()",window.config.showurl);

  return true;

}

 

function scrollit_r2l()

{

  var out=" ";

  var c=0;

 

  if (window.config.seed <= window.config.barwidth && window.config.seed > 0) {

    for (c=0 ; c < window.config.seed ; c++) {

      out+=" ";

    }

    out+=window.config.list[window.config.num];

    window.config.seed--;

    window.status=out;

    window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay);

  }

  else if (window.config.seed <= 0) {

    if (-window.config.seed < window.config.list[window.config.num].length) {

      out+=window.config.list[window.config.num].substring(-window.config.seed,window.config.list[window.config.num].length);

      window.config.seed--;

      window.status=out;

      window.config.timer=window.setTimeout("scrollit_r2l()",window.config.delay);

    }

    else {

      window.status=" ";

      window.config.num++;

      window.config.timer=window.setTimeout("sbprint()",window.config.msgdisp);

    }

  }

}

 

window.config=new mkcfg(7);

window.config.list[1]="欢迎你的光临";

window.config.type[1]=0;

window.config.list[2]="这里是7stk";

window.config.type[2]=0;

window.config.list[3]="这里有许多精彩的内容";

window.config.type[3]=0;

window.config.list[4]="javascriptflashLOGO、背景图片、论坛";

window.config.type[4]=0;

window.config.list[5]="在这里一定会找到你需要的内容";

window.config.type[5]=0;

window.config.list[6]="赶快试试吧";

window.config.type[6]=0;

window.config.list[7]="别急着走,记得下次光临哟!!!";

window.config.type[7]=0;

 

function sbprint()

{

  if (window.config.num <= window.config.list.length) {

    if (window.config.type[window.config.num] == 0) {

      window.status=window.config.list[window.config.num];

      window.config.num++;

      window.clearTimeout(window.config.timer);

      window.config.timer=window.setTimeout('sbprint()',window.config.msgdisp);

    }

    else if (window.config.type[window.config.num] == 1) {

      window.config.seed=window.config.barwidth;

      scrollit_r2l();

    }

  }

  else if (window.config.looping) {

    window.config.num=1;

    window.clearTimeout(window.config.timer);

    window.config.timer=window.setTimeout('sbprint()',window.config.delay);

  }

}

//  End -->

</script>

 

 

 

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

<body bgcolor="#fef4d9" onload="window.config.timer=window.setTimeout('sbprint()',window.config.delay);">

0 Comments

Mon

02

Mar

2009

57、显示剩余时间

57、显示剩余时间

脚本说明:

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

<script>

<!--

var limit="1:10"

if (document.images){

var parselimit=limit.split(":")

parselimit=parselimit[0]*60+parselimit[1]*1

}

function begintimer(){

if (!document.images)

return

if (parselimit==1)

window.location="http://www.7stk.com"

else{

parselimit-=1

curmin=Math.floor(parselimit/60)

cursec=parselimit%60

if (curmin!=0)

curtime=curmin+" "+cursec+" 秒离开"

else

curtime=cursec+" 秒离开"

window.status=curtime

setTimeout("begintimer()",1000)

}

}

//-->

</script>

 

 

 

 

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

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

0 Comments

Mon

02

Mar

2009

56、状态栏登陆时间

56、状态栏登陆时间

脚本说明:

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

<script>

 

    var Temp;

    var TimerId = null;

    var TimerRunning = false;

 

    Seconds = 0

    Minutes = 0

    Hours = 0

 

    function showtime()

    {

      if(Seconds >= 59)

      {

        Seconds = 0

        if(Minutes >= 59)

        {

          Minutes = 0

          if(Hours >= 23)

          {

            Seconds = 0

            Minutes = 0

            Hours = 0

          }

          else {

            ++Hours

          }

        }

        else {

          ++Minutes

        }

      }

      else {

        ++Seconds

      }

 

      if(Seconds != 1) { var ss="s" } else { var ss="" }

      if(Minutes != 1) { var ms="s" } else { var ms="" }

      if(Hours != 1) { var hs="s" } else { var hs="" }

 

      Temp = '你在本页停留了 '+Hours+' 小时'+', '+Minutes+' '+', '+Seconds+' '+''

      window.status = Temp;

      TimerId = setTimeout("showtime()", 1000);

      TimerRunning = true;

    }

 

    var TimerId = null;

    var TimerRunning = false;

 

    function stopClock() {

      if(TimerRunning)

        clearTimeout(TimerId);

        TimerRunning = false;

    }

 

    function startClock() {

      stopClock();

      showtime();

    }

 

    function stat(txt) {

      window.status = txt;

      setTimeout("erase()", 2000);

    }

 

    function erase() {

      window.status = "";

    }

 

</SCRIPT>

 

 

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

<body bgcolor="#fef4d9" onLoad="startClock()">

0 Comments

Mon

02

Mar

2009

55、状态栏显示打开百分比

55、状态栏显示打开百分比

脚本说明:

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

<script language=VBScript>

Dim Bar, Line, SP

Bar = 0 

Line = "|"

SP = 100

 

Function Window_onLoad()

  Bar = 95

  SP = 10

End Function

 

Function Count()

  If Bar < 100 Then

    Bar = Bar + 1

    Window.Status = "已经完成了" & Bar & "%" &  " " & String(Bar, Line)

    setTimeout "Count()", SP

  Else

    Window.Status = "欢迎你的光临!!!"

    Document.Body.Style.Display = ""

  End If   

End Function

 

Call Count()

</script>

0 Comments

Mon

02

Mar

2009

54、状态栏显示鼠标坐标

54、状态栏显示鼠标坐标

脚本说明:

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

<script language="javascript">

 

var where = ""; // which link

function checkwhere(e) {

        if (document.layers){

        xCoord = e.x;

        yCoord = e.y;

}

        else if (document.all){

        xCoord = event.clientX;

        yCoord = event.clientY;

}

        else if (document.getElementById){

        xCoord = e.clientX;

        yCoord = e.clientY;

}

        self.status = "X座标值= "+ xCoord + "  Y座标值= " + yCoord +   " ---欢迎你的光临";

        }

 

 

document.onmousemove = checkwhere;

if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

 

</script>

0 Comments

Mon

02

Mar

2009

53、状态栏字母大小写转换

53、状态栏字母大小写转换

脚本说明:

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

<script language=JavaScript>

<!--

var text="www.7stk.com"

var speed=200

var x=0

function s2b()

{var a=text.substring(0,x)

var b=text.substring(x,x+1).toUpperCase()

var c=text.substring(x+1,text.length)

window.status=a+b+c

if(x==text.length){x=0}

else{x++}setTimeout("s2b()",speed)}

s2b();

//-->

</script>

0 Comments

Mon

02

Mar

2009

52、状态栏显示全部时间

52、状态栏显示全部时间

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var today = new Date();

var Day = today.getDay();

var Date = today.getDate();

var Mnth = today.getMonth();

var Hrs = today.getHours();

var Mins = today.getMinutes();

 

//********** THE SWITCH *************

//11 = Date & Time. 10 = Date. 01 = Time.

var DTswitch = 11;

 

var DayNam = new Array(

"Sunday",

"Monday",

"Tuesday",

"Wednesday",

"Thursday",

"Friday",

"Saturday");

 

var MnthNam = new Array(

"January",

"February",

"March",

"April",

"May",

"June",

"July",

"August",

"September",

"October",

"November",

"December");

var Date = Date + "th"

if (Date == 1 || Date == 21 || Date == 31) {Date= Date + "st";}

if (Date == 2 || Date == 22) {Date= Date + "nd";}

if (Date == 3 || Date == 23) {Date= Date + "rd";}

if (Hrs < 10) {Hrs = "0" + Hrs;}

if (Mins < 10) {Mins = "0" + Mins;}

var DateIt = DayNam[today.getDay()] + " " + Date + " " + MnthNam[Mnth];

var TimeIt = Hrs+":"+Mins;

if (DTswitch == 11) {var DateTime = DateIt + "  " + TimeIt;}

if (DTswitch == 10) {var DateTime = DateIt;}

if (DTswitch == 01) {var DateTime = TimeIt;}

window.status=DateTime;

//  End -->

</script>

 

 

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

<body  onLoad="window.status=DateTime;">

0 Comments

Mon

02

Mar

2009

51、状态栏全日制时间

51、状态栏全日制时间

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function dateinbar()

{

var d=new Date();

var mon=d.getMonth()+1;

var year=d.getFullYear();

var date=d.getDate();

var h=d.getHours();

var m=d.getMinutes();

var s=d.getSeconds();

var AorP=" ";

if (h>=12)

    AorP="P.M.";

else

    AorP="A.M.";

if (h>=13)

    h=h-12;

if (s<10)

    s="0"+s;

if (m<10)

    m="0"+m;

defaultStatus = "当前日期:  "+mon+"/"+date+"/"+year+" "+" 当前时间:  " + h+":"+m+":"+s+" "+AorP ;

setTimeout("dateinbar()",1000);

}

dateinbar();

//  End -->

</script>

 

0 Comments

Mon

02

Mar

2009

50、鼠标驱动状态栏变化

50、鼠标驱动状态栏变化

脚本说明:

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

<TABLE height="100%" cellSpacing=0 cellPadding=4 align=left border=0>

  <TBODY>

  <TR>

    <TD vAlign=bottom align=left><NOBR><FONT size=4><A

      onmouseover="window.status='|                      =                       =                       =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status=' |                    =                      =                      =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='  |                  =                     =                     =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='   |                =                    =                    =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='    |              =                   =                   =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='     |            =                  =                  =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='      |          =                 =                 =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='       |        =                =                =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='        |      =               =               =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='         |    =              =              =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='          |  =             =             =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='           |=            =            =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='           =|          =           =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='          =  |       =          =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='         =    |    =         =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='        =      | =        =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='       =       =|      =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='      =      =   |  =';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='     =     =     =|';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='    =    =    =    |';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='   =   =   =        |';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='  =  =  =            |';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status=' = = =                |';return true"

      href="http://www.7stk.com">| </A><A

      onmouseover="window.status='===                    |';return true"

      href="http://www.7stk.com">|</A>

  </FONT></NOBR></TD></TR></TBODY></TABLE

0 Comments

Mon

02

Mar

2009

49、状态栏和标题栏显示时间

49、状态栏和标题栏显示时间

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

function clock() {

var title="现在时间为:";

var date=new Date();

var year=date.getYear();

var month=date.getMonth();

var day=date.getDate();

var hour=date.getHours();

var minute=date.getMinutes();

var second=date.getSeconds();

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

 

var monthname=months[month];

 

if (hour > 12) {

hour=hour- 12;

}

 

if (minute < 10) {

minute="0"+minute;

}

 

if (second < 10) {

second="0"+second;

}

 

 

document.title=title+" "+monthname+" "+day+", "+year+" - "+hour+":"+minute+":"+second;

status=title+" "+monthname+" "+day+", "+year+" - "+hour+":"+minute+":"+second;

 

setTimeout("clock()", 1000)

 

}

</script>

 

 

      

第二步:把<body>中的代码改为:

<BODY onLoad="clock()">

0 Comments

Mon

02

Mar

2009

48、不断变化的网页标题栏

48、不断变化的网页标题栏

<html>

 

<head>

 

<title>http://www.7stk.com</title><SCRIPT>

<!--

var thetitle="▁网页☉特效▁,▂网页⊙特效▂,▃网页〇特效▃,▄网页◎特效▄,▅网页☉特效▅,▆网页⊙特效▆,▇网页〇特效▇,█网页◎特效█,█网页◎特效█,▇网页〇特效▇,▆网页⊙特效▆,▅网页☉特效▅,▄网页◎特效▄,▃网页〇特效▃,▂网页⊙特效▂,▁网页☉特效▁";

var to=0;

var mx = 0;

var my = 0;

var sd=1;

tracescript = '';

 

function tytitle()

{

var d;

d=thetitle.split(',');

window.document.title=d[to];

if(to <d.length-1)

{

to++;

}else

{

to=0;

}

setTimeout("tytitle()",200);

}

// End -->

</SCRIPT></head>

 

<body onload="tytitle()">

</head>

</HTML>

 

 

 

0 Comments

Mon

02

Mar

2009

47、标题栏文字的替换显现

47、标题栏文字的替换显现

要完成此效果把如下代码加入到<head>区域中

 

<SCRIPT LANGUAGE="JavaScript">

var message = new Array();

message[0] = "Welcome To You...";

message[1] = "JavaScript Fairyland...";

message[2] = "7stk.com...";

 

 

var reps = 1;

var speed = 275;// Set the overall typing speed (larger number = slower action).

var hold = 4 // set the length of time to display the whole phrase before retyping (larger number = longer)

 

var p = message.length;

var q = 0;

var r = 0;

var C = 0;

var mC = 0;

var s = 0;

var sT = null;

 

if (reps < 1) {

reps = 1;

}

function setMessage() {

typing = message[mC];

q = typing.length;

r = q + hold;

typeMessage();

}

function typeMessage() {

if (s > r) {

s = 0;

}

if (s > q) {

document.title = '|- '+ typing +' - - -';

}

else {

document.title = '|- '+ typing.substr(0,s)+' - - -';

}

if (C < (r * reps)) {

sT = setTimeout("typeMessage()", speed);

C++;

s++;

}

else {

C = 0;

s = 0;

mC++;

if(mC > p - 1) {mC = 0;}

sT = null;

setMessage();

   }

}

setMessage();

</script>

 

>

0 Comments

Mon

02

Mar

2009

46、标题栏打字效果

46、标题栏打字效果

<script language="JavaScript1.2">

var message="7stk.com"

var message=message+" "

i="0"

var temptitle=""

var speed="150"

function titler(){

if (!document.all&&!document.getElementById)

return

document.title=temptitle+message.charAt(i)

temptitle=temptitle+message.charAt(i)

i++

if(i==message.length)

{

i="0"

temptitle=""

}

setTimeout("titler()",speed)

}

window.onload=titler

</script>

 

 

0 Comments

Mon

02

Mar

2009

45、单个字出现后再整句

45、单个字出现后再整句

<!-- 要实现此效果需要 1 个步骤: -->

 

<!-- 1 步: -->

<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

 

<script language="JavaScript">

<!--

var current = 0

var x = 0

var speed = 200

var speed2 = 5000

 

function initArray(n) {

this.length = n;

for (var i =1; i <= n; i++) {

this[i] = ' '

}

}

 

action = new initArray(4)

action[0]="欢迎光临!"

action[1]="这里是www.pkvs.com!"

action[2]="你所关注的就是我们所关注的!"

action[3]="再次感谢你的光临!"

 

function action2() {

var m = action[current]

 

window.status = m.charAt(x++)

 

if (x == m.length + 1) {

x = 0

current++

window.status = m

 

if (current > action.length - 1) {

current = 0

}

 

setTimeout("action2()", speed2)

}

 

else {

setTimeout("action2()", speed)

}

}

 

action2()

//-->

</script

0 Comments

Mon

02

Mar

2009

44、状态栏显示链接内容特效

44、状态栏显示链接内容特效

要完成此效果需要两个步骤

 

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

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var data = "0123456789";

var done = 1;

function statusIn(text) {

decrypt(text, 2, 1);

}

 

function statusOut() {

self.status = '';

done = 1;

}

 

function decrypt(text, max, delay) {

if (done) {

done = 0;

decrypt_helper(text, max, delay,  0, max);

   }

}

function decrypt_helper(text, runs_left, delay, charvar, max) {

if (!done) {

runs_left = runs_left - 1;

var status = text.substring(0, charvar);

for (var current_char = charvar; current_char < text.length; current_char++) {

status += data.charAt(Math.round(Math.random()*data.length));

}

window.status = status;

var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"

var new_char = charvar + 1;

var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"

if(runs_left > 0) {

setTimeout(rerun, delay);

}

else {

if (charvar < text.length) {

setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));

}

else {

done = 1;

         }

      }

   }

}

//  End -->

</script>

 

 

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

 

<center>

<a href="http://7stk.com/"

onMouseOver="statusIn('The JavaScript Fairyland. [http://7stk.com/]');return true;"

onMouseOut="statusOut();">free.2259.com</a>

</center>

 

>

0 Comments

Mon

02

Mar

2009

43、状态栏中显示页面载入进度

43、状态栏中显示页面载入进度

要完成此效果把如下代码加入到<body>区域中

 

<script language=VBScript>

Dim Bar, Line, SP

Bar = 0 

Line = "|"

SP = 100

 

Function Window_onLoad()

  Bar = 95

  SP = 10

End Function

 

Function Count()

  If Bar < 100 Then

    Bar = Bar + 1

    Window.Status = "已成功下载" & Bar & "%" &  " " & String(Bar, Line)

    setTimeout "Count()", SP

  Else

    Window.Status = "欢迎你的光临!!!"

    Document.Body.Style.Display = ""

  End If   

End Function

 

Call Count()

</script>

 

0 Comments

Mon

02

Mar

2009

42、标题栏文字按时转换2

42、标题栏文字按时转换2

要完成此效果需要两个步骤

 

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

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function settitle() {

var a = "你看到这里的变化了吗? ";

var b = "此脚本十秒种后自动改变标题";

var c = "你想好这里放什么内容了吗?";

 var t = new Date();

 s = t.getSeconds();

 if (s == 10) {

  document.title = a;}

 else if (s == 20) {

 document.title = b;}

 else if (s == 30) {

 document.title = c;}

 else if (s == 40) {

 document.title = a;}

 else if (s == 50) {

 document.title = b;}

 else if (s == 00) {

 document.title = c;}

 setTimeout("settitle()", 1000);

 }

//  End -->

</script>

 

 

第二步:把“onLoad="settitle()"”加在<body>标记里

例如:<body onLoad="settitle()">

 

0 Comments

Mon

02

Mar

2009

41、栏标题栏文字按时转换

41、栏标题栏文字按时转换

要完成此效果需要两个步骤

 

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

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

function settitle() {

var a = "你看到这里的变化了吗? ";

var b = "此脚本十秒种后自动改变标题";

var c = "你想好这里放什么内容了吗?";

 var t = new Date();

 s = t.getSeconds();

 if (s == 10) {

  document.title = a;}

 else if (s == 20) {

 document.title = b;}

 else if (s == 30) {

 document.title = c;}

 else if (s == 40) {

 document.title = a;}

 else if (s == 50) {

 document.title = b;}

 else if (s == 00) {

 document.title = c;}

 setTimeout("settitle()", 1000);

 }

//  End -->

</script>

 

 

第二步:把“onLoad="settitle()"”加在<body>标记里

例如:<body onLoad="settitle()">

 

 

0 Comments

Mon

02

Mar

2009

40、标题栏上显示鼠标座标

40、标题栏上显示鼠标座标

要完成此效果把如下代码加入到<body>区域中

 

<script language="javascript">

var where = "";

function checkwhere(e) {

        if (document.layers){

        xCoord = e.x;

        yCoord = e.y;

}

        else if (document.all){

        xCoord = event.clientX;

        yCoord = event.clientY;

}

        else if (document.getElementById){

        xCoord = e.clientX;

        yCoord = e.clientY;

}

        document.title = "X座标值= "+ xCoord + "  Y座标值= " + yCoord ;

        }

document.onmousemove = checkwhere;

if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

</script>

 

0 Comments

Mon

02

Mar

2009

39、字符从状态栏右边一个个的“射”出来

39、字符从状态栏右边一个个的“射”出来

要完成此效果把如下代码加入到<head>区域中

 

<script language="JavaScript">

 

   var MESSAGE  =   "  欢迎来到网页特效站,请多提意见。谢谢!    "

 

   var POSITION = 150

 

   var DELAY    = 10

 

   var scroll = new statusMessageObject()

 

 function statusMessageObject(p,d) {

 

  this.msg = MESSAGE

 

  this.out = " "

 

  this.pos = POSITION

 

  this.delay = DELAY

 

  this.i     = 0

 

  this.reset = clearMessage}

 

function clearMessage() {

 

  this.pos = POSITION}

 

function scroller() {

 

  for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++) {

 

    scroll.out += " "}

 

  if (scroll.pos >= 0)

 

   scroll.out += scroll.msg

 

  else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length)

 

  window.status = scroll.out

 

  scroll.out = " "

 

  scroll.pos--

 

  if (scroll.pos < -(scroll.msg.length)) {

 

   scroll.reset()}

 

  setTimeout ('scroller()',scroll.delay)}

 

function snapIn(jumpSpaces,position) {

 

  var msg = scroll.msg

 

  var out = ""

 

  for (var i=0; i<position; i++)

 

    {out += msg.charAt(i)}

 

  for (i=1;i<jumpSpaces;i++)

 

    {out += " "}

 

  out += msg.charAt(position)

 

  window.status = out

 

  if (jumpSpaces <= 1) {

 

    position++

 

    if (msg.charAt(position) == ' ')

 

      {position++ }

 

    jumpSpaces = 100-position

 

  } else if (jumpSpaces >  3)

 

       {jumpSpaces *= .75}

 

  else

 

    {jumpSpaces--}

 

  if (position != msg.length) {

 

    var cmd = "snapIn(" + jumpSpaces + "," + position + ")";

 

    scrollID = window.setTimeout(cmd,scroll.delay);

 

  } else {    window.status=""

 

    jumpSpaces=0

 

    position=0

 

    cmd = "snapIn(" + jumpSpaces + "," + position + ")";

 

    scrollID = window.setTimeout(cmd,scroll.delay);

 

    return false }

 

  return true}

 

snapIn(100,0);

 

</script>

 

0 Comments

Mon

02

Mar

2009

38、状态栏字符从右向左的移动

38、状态栏字符从右向左的移动

要完成此效果把如下代码加入到<head>区域中

 

<script>

 

<!-- Beginning of JavaScript Applet -------------------

 

function scrollit_r2l(seed)

 

{ var m1  = "欢迎来到网页特效,请多提意见。谢谢!" ;

 

 var m2  = "" ;

 

       var msg=m1+m2;

 

       var out = " ";

 

       var c = 1;

 

 var speed  = 120;

 

if (seed > 100)

 

{                seed-=2;

 

                var cmd="scrollit_r2l(" + seed + ")";  

 

             timerTwo=window.setTimeout(cmd,speed);}    

 

    else if (seed <= 100 && seed > 0)

 

     {                for (c=0 ; c < seed ; c++)

 

                      {       out+=" ";}  

 

       out+=msg;         seed-=2;     

 

   var cmd="scrollit_r2l(" + seed + ")";     

 

   window.status=out;        

 

 timerTwo=window.setTimeout(cmd,speed); }       

 

      else if (seed <= 0)

 

{                if (-seed < msg.length)

 

                  {

 

                       out+=msg.substring(-seed,msg.length);       

 

                       seed-=2;                       

 

                       var cmd="scrollit_r2l(" + seed + ")";        

 

                       window.status=out;                    

 

       timerTwo=window.setTimeout(cmd,speed);}

 

       else {               window.status=" ";      

 

                 timerTwo=window.setTimeout("scrollit_r2l(100)",speed);

 

}

 

}

 

}

 

scrollit_r2l(100);

 

// -- End of JavaScript code -->

 

</script>

 

 

0 Comments

Mon

02

Mar

2009

37、一多句状态栏字符显示效果

37、一多句状态栏字符显示效果

要完成此效果需要两个步骤

 

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

 

<script language="javascript">

 

<!-- Hide this script from old browsers --

 

var speed = 10

 

var pause = 1500

 

var timerID = null

 

var bannerRunning = false

 

var ar = new Array()

 

ar[0] = "欢迎来到7stk.com  "

 

ar[1] = "欢迎光临网页特效"

 

ar[2] = "请多提意见,谢谢!    "

 

 

 

var message = 0

 

var state = ""

 

clearState()

 

function stopBanner() {

 

        if (bannerRunning)

 

                clearTimeout(timerID)

 

        bannerRunning = false

 

}

 

 

 

function startBanner() {

 

        stopBanner()

 

        showBanner()

 

}

 

function clearState() {

 

        state = ""

 

        for (var i = 0; i < ar[message].length; ++i) {

 

                state += "0"

 

        }

 

}

 

function showBanner() {

 

        if (getString()) {

 

                message++

 

                if (ar.length <= message)

 

                        message = 0

 

                clearState()

 

                timerID = setTimeout("showBanner()", pause)

 

                bannerRunning = true

 

        } else {

 

                var str = ""

 

                for (var j = 0; j < state.length; ++j) {

 

                        str += (state.charAt(j) == "1") ? ar[message].charAt(j) : "     "

 

                }

 

                window.status = str

 

                timerID = setTimeout("showBanner()", speed)

 

                bannerRunning = true

 

        }

 

}

 

function getString() {

 

        var full = true

 

        for (var j = 0; j < state.length; ++j) {

 

                if (state.charAt(j) == 0)

 

                        full = false

 

        }

 

        if (full)

 

                return true

 

        while (1) {

 

                var num = getRandom(ar[message].length)

 

                if (state.charAt(num) == "0")

 

                        break

 

        }

 

        state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)

 

        return false

 

}

 

function getRandom(max) {

 

        return Math.round((max - 1) * Math.random())

 

}

 

// -- End Hiding Here -->

 

</script>

 

 

第二步:把“onLoad="startBanner()"”加在<body>标记里

例如:<body onLoad="startBanner()">

 

0 Comments

Mon

02

Mar

2009

36、文字符状态栏不停跳动闪烁

36、文字符状态栏不停跳动闪烁

要完成此效果需要两个步骤

 

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

 

<script language="">

 

<!--

 

var yourwords = "欢迎光临网页特效!!!";

 

var speed = 700;

 

var control = 1;

 

function flash()

 

{

 

  if (control == 1)

 

    {

 

      window.status=yourwords;

 

      control=0;

 

    } 

 

  else

 

    {

 

      window.status="";

 

      control=1;

 

    }

 

  setTimeout("flash()",speed);

 

}

 

// -->

 

</script>

 

 

第二步:把“onLoad="flash()"”加在<body>标记里

例如:<body onLoad="flash()">

 

0 Comments

Mon

02

Mar

2009

35、状态栏始终显示固定的信息

35、状态栏始终显示固定的信息

要完成上效果把“onmouseover="self.status='欢迎光临网页特效;return true"”加在<body>标记里

例如:<body onmouseover="self.status='欢迎光临网页特效;return true">

 

0 Comments

Mon

02

Mar

2009

34、在标题栏显示时间

34、在标题栏显示时间

要完成此效果把如下代码加入到<body>区域中

 

<SCRIPT LANGUAGE="JavaScript">

 

 

 

 

 

 

<!-- Begin

 

var clocktext;

 

var pagetitle = document.title;

 

function scroll() {

 

today = new Date();

 

sec = today.getSeconds();

 

hr = today.getHours();

 

min = today.getMinutes();

 

if (hr <= 9) hr = "0" + hr;

 

if (min <= 9) min = "0" + min;

 

if (sec <= 9) sec = "0" + sec;

 

var clocktext = " 现在时间是: " + hr + ":" + min + ":" + sec;

 

clocktimer = setTimeout("scroll()", 1000);

 

document.title = pagetitle + clocktext;

 

}

 

if (document.all) scroll();

 

//  End -->

 

</script>

 

0 Comments

Mon

02

Mar

2009

33、状态栏文字由中向两边显示

33、状态栏文字由中向两边显示

要完成此效果需要两个步骤

 

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

 

<SCRIPT LANGUAGE="JavaScript">

<!-- hide script from old browsers

var phrase = "欢迎光临网页特效,请记住我们的网址:http://7stk.com";

var lenPhrase = phrase.length;

var phraseOut = "";

var pause = 100;

var i=0;

var j=0;

function explode() {

    i++;

    phraseOut = "";

    for (j=1; j<=(lenPhrase/2)-i; j++) {

      phraseOut += "  ";

    }

    for (j=1; j<=i; j++) {

      phraseOut += phrase.charAt(j-1);

    }

    for (j=i; j>=1; j--) {

      phraseOut += phrase.charAt(lenPhrase-j);

    }

    for (j=1; j<=(lenPhrase/2)-i; j++) {

      phraseOut += "  ";

    }

    window.status = phraseOut;

    if (i<lenPhrase/2) {

        setTimeout("explode()",pause);

    }

}

// end hiding contents -->

</SCRIPT>

 

 

第二步:把“OnLoad="explode()"”加在<body>标记里

例如:<body OnLoad="explode()">

 

0 Comments

Mon

02

Mar

2009

32、状态栏字符有点冒泡的感觉

32、状态栏字符有点冒泡的感觉

要完成此效果需要两个步骤

 

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

 

<script language="JavaScript">

 

  <!-- Funny text script by Bart Jellema

    var hellotext="欢迎光临网页特效"

    var thetext=""

    var started=false

    var step=0

    var times=1

 

    function welcometext()

    {

      times--

      if (times==0)

      {

        if (started==false)

        {

          started = true;

          window.status = hellotext;

          setTimeout("anim()",1);

        }

        thetext = hellotext;

      }

    }

 

    function showstatustext(txt)

    {

      thetext = txt;

      setTimeout("welcometext()",4000)

      times++

    }

 

    function anim()

    {

      step++

      if (step==7) {step=1}

      if (step==1) {window.status='>==='+thetext+'===<'}

      if (step==2) {window.status='=>=='+thetext+'==<='}

      if (step==3) {window.status='>=>='+thetext+'=<=<'}

      if (step==4) {window.status='=>=>'+thetext+'<=<='}

      if (step==5) {window.status='==>='+thetext+'=<=='}

      if (step==6) {window.status='===>'+thetext+'<==='}

      setTimeout("anim()",200);

    }

 

 

</script>

 

 

第二步:把“onLoad="welcometext()"”加在<body>标记里

例如:<body onLoad="welcometext()">

 

0 Comments

Mon

02

Mar

2009

31、状态栏的字符先杂乱出现再排列组合

31、状态栏的字符先杂乱出现再排列组合

本特效共分两步:

 

1.<head></head>中加入

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- hide from old browsers

 

 

var str=""

var direction="left"

 

function createArray(n)

{

    for (var i = 0; i < n; i++) {this[i] = 0}

    return this

}

 

var js_mult1=3141

var js_mult2=5821

var js_m1=100000000

var js_m2=10000

var js_iseed=0

var js_iseed1=0

var js_iseed2=0

 

 

function random(n)

{

    if (js_iseed == 0)

    {

        now = new Date()

        js_iseed = now.getHours() + now.getMinutes() * 60

                    + now.getSeconds() * 3600

    }

    js_iseed1 = js_iseed / js_m2

    js_iseed2 = js_iseed % js_m2

    var tmp = (((js_iseed2 * js_mult1 + js_iseed1 * js_mult2) % js_m2) *

                js_m2 + (js_iseed2 * js_mult2)) % js_m1

    js_iseed = (tmp + 1) % js_m1

    return (Math.floor((js_iseed/js_m1) * n))

}

 

 

 

msgArray = createArray(5)

msgArray[0] = "&raquo;&para;&Oacute;&shy;&sup1;&acirc;&Aacute;&Ugrave;,&Otilde;&acirc;&Agrave;&iuml;&Ecirc;&Ccedil;Typhoon Start"

msgArray[1] = "JavaScript Fairyland&Ecirc;&Ccedil;&Auml;&atilde;&Agrave;í&Iuml;&euml;&micro;&Auml;&Egrave;&yen;&acute;&brvbar;"

 

msg = ""

dmsg = ""

 

 

function doMessage()

{

    if (msg == dmsg) // reset and delay

    {

       

        msg = msgArray[random(5)]

       

       

        dmsg = ""

        for (var ii = 0; ii < msg.length; ii++) dmsg += " "

       

       

        JSCTimeOutID = window.setTimeout('doMessage()',100)

        return true

    }

   

    // pick a character

    var ii = random(msg.length)

   

  

    var astr = dmsg.substring(0, ii)

    var bstr = msg.substring(ii, ii+1)

    var cstr = dmsg.substring(ii+1, dmsg.length)

   

  

    dmsg = astr+bstr+cstr

    window.status = dmsg

   

   

    JSCTimeOutID = window.setTimeout('doMessage()',50)

   

  

    return true

}

 

<!-- done hiding -->

 

</SCRIPT>

 

 

2.把下面代码加入<body> onload="JSCTimeOutID = window.setTimeout('doMessage()',500);"

 

例如:<body onload="JSCTimeOutID = window.setTimeout('doMessage()',500);">

 

 

0 Comments