上一页       3     4     5     6            下一页

 

文字特效代码7

 

Thu

26

Feb

2009

210、变幻多彩的文字公告牌

210、变幻多彩的文字公告牌

1把如下代码复制到<head></head>之间

 

<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>

<style>

v\:* { behavior: url(#default#VML); }

</style>

 

2把如下代码复制到<body></body>之间

 

 

<table width=200 height=200 border=0 cellpadding=0 cellspacing=0>

<tr><td>

<SCRIPT>

 

var text=new Array()

var textlink=new Array()

var texttarget=new Array()

 

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

// EDITZONE STARTS HERE

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

 

// Add your messages. They should be rather short.

// They should have the same length more or less.

text[0]="网页特效集锦"

text[1]="网页特效集锦"

text[2]="背景特效"

text[3]="整站模板"

text[4]="网页特效"

text[5]="导航特效"

text[6]="精彩"

text[7]="资源丰富"

 

 

// Add a link for each message

// If you don't want to link a message enter "#" instead (see sample below)

textlink[0]="http://code.xinnew.com"

textlink[1]="http://code.xinnew.com"

textlink[2]="http://code.xinnew.com/background/index.htm"

textlink[3]="http://code.xinnew.com/moban/index.htm"

textlink[4]="http://code.xinnew.com/navigation/index.htm"

textlink[5]="http://code.xinnew.com/img/index.htm"

textlink[6]="http://code.xinnew.com"

textlink[7]="http://code.xinnew.com"

 

 

// Add a target-window for each link

// Possible values: "_blank","_top", "_self", "_parent" or the name of a frame

texttarget[0]="_blank"

texttarget[1]="_blank"

texttarget[2]="_blank"

texttarget[3]="_blank"

texttarget[4]="_blank"

texttarget[5]="_top"

texttarget[6]="_parent"

texttarget[7]="_self"

 

 

// Set the font

var textfont="Arial Black"

 

// Add as many font-colors as you like

var textfontcolor=new Array("#FF0000","#0000FF","#00FF00","#660000")

 

// Add as many font-outline-colors as you like

var outlinecolor=new Array("#000000","#000000","#FDCF15")

 

// Add as many font-shadow-colors as you like

var shadowcolor=new Array("#FFFF00","#00FFFF","#FDCF15")

 

// Set the font-rollovercolor (required for Netscape and Opera only)

var textfontcolorrollover="#ff0000"

 

// Set the font-size (required for Netscape and Opera only)

var textfontsize=20

 

// Set the background-color

var textbgcolor="#000000"

 

// Set "bold" or "normal" (required for Netscape and Opera only)

var textweight="normal"

 

// Set "italic" or "normal" (required for Netscape and Opera only)rsiv sein soll

var textitalic="normal"

 

// Set width and height of your Fun Ticker (pixels)

// IMPORTANT: width and height must also be set in the table (see top of code)

var textwidth=200

var textheight=200

 

// Set the delay between the messages (seconds)

var textpause=2

 

// Set the width of the funticker's border (pixels)

var funtickerborder=3

 

// Set the color of the funticker's border

var funtickerbordercolor="#FDCF15"

 

// Set the width of the font-outline (pixels)

var widthfontoutline=1

 

// Set the strength of the font's opacity (transparency of letters)

var fontopacity="50%"

 

// Set the strength of the shadow's opacity (transparency of shadow)

var shadowopacity="50%"

 

// Set true if your font should display a gradient effect

// Set false if your font should display NO gradient effect

var applygradient=true

 

// Enter a value between 0 and 3 to set the shape for your messages

// If you enter 4 all shapes will be applied

var i_shape=4

 

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

// EDITZONE ENDS HERE

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

 

var path=new Array()

path[0]="m20 0c300 140,300 50,580, 0m20 300c400 100,300 250,580 300e"

path[1]="m20 100c300 -50,300 50,580, 100m20 200c300 400,300 300,580 200e"

path[2]="m20 120c300 100,300 50,580, 0m20 180c300 180,300 300,580 300e"

path[3]="m20 0c300 140,300 50,580, 0m150 300c400 100,300 250,450 300e"

 

var i_path=0

var speed=60

var textdecoration="none"

 

var innerwidth=Math.floor(0.90*textwidth)

var innerheight=Math.floor(0.90*textheight)

 

var posleft=Math.floor((textwidth-innerwidth)/2-funtickerborder)

var postop=Math.floor((textheight-innerheight)/2)

 

var i_message=0

var i_messagelength=0

var i_outlinecolor=0

var i_textfontcolor=0

var i_shadowcolor=0

 

var textalign="center"

var textvalign="middle"

var textitalicA=""

var textitalicB=""

var textweightA=""

var textweightB=""

var textfontsizeHTML=1

var i_mes=0

 

var i_substring=0

var i_presubstring=0

var i_text=0

var textcontent=""

var notag=true

var textpresubstring=""

var textaftersubstring=""

textpause*=1000

 

var browserinfos=navigator.userAgent

var ie4=!document.getElementById&&document.all&&!browserinfos.match(/Opera/)

var ie5=document.getElementById&&document.all&&!browserinfos.match(/Opera/)

var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)

var opera=browserinfos.match(/Opera/) 

 

function gettextcontent() {

       tablewidth=textwidth-2*funtickerborder

       tableheight=textheight-2*funtickerborder

       textpresubstring=text[i_text].substring(0,i_presubstring)

       var i_prepre=i_presubstring-1

       if (i_prepre<0) {i_prepre=0}

       if (text[i_text].substring(i_prepre,i_presubstring)=="<"){notag=false}

       if (text[i_text].substring(i_prepre,i_presubstring)==">"){notag=true}

       if (notag) {

              textcontent="<table border=0 cellpadding=4 width="+tablewidth+" height="+tableheight+"><tr valign="+textvalign+"><td align="+textalign+">"

              textcontent+="<a href='"+textlink[i_text]+"' target='"+texttarget[i_text]+"' style='position:relative; font-family:"+textfont+";text-decoration:"+textdecoration+";font-family:"+textfont+";color:"+textfontcolor[i_textfontcolor]+";font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+"' onMouseOver=\"this.style.color=\'"+textfontcolorrollover+"\'\" onMouseOut=\"this.style.color=\'"+textfontcolor[i_textfontcolor]+"\'\">"

              textcontent+=textpresubstring

              textcontent+="</a>"

              textcontent+="</td></tr></table>"

       }

}

 

function showtickerNS6() {

       textcontent="<table border=0 cellpadding=4 width="+textwidth+" height="+textheight+"><tr valign="+textvalign+"><td align="+textalign+">"

       textcontent+="<a href='"+textlink[i_text]+"' target='"+texttarget[i_text]+"' style='position:relative; font-family:"+textfont+";text-decoration:"+textdecoration+";font-family:"+textfont+";color:"+textfontcolor[i_textfontcolor]+";font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+"' onMouseOver=\"this.style.color=\'"+textfontcolorrollover+"\'\" onMouseOut=\"this.style.color=\'"+textfontcolor[i_textfontcolor]+"\'\">"

       textcontent+=text[i_text]

       textcontent+="</a>"

       textcontent+="</td></tr></table>"

       document.getElementById("ticker").innerHTML=textcontent

       i_text++

       i_textfontcolor++

       if (i_text>=text.length) {i_text=0}

       if (i_textfontcolor>=textfontcolor.length-1) {i_textfontcolor=0}

       var timer=setTimeout("showtickerNS6()", textpause)

}

 

function showticker() {

       if (i_substring<=text[i_text].length) {

                     i_substring++

                     i_presubstring=i_substring-1

                     if (i_presubstring<0) {i_presubstring=0}

                     gettextcontent()

              if (opera) {

                     document.getElementById("ticker").innerHTML=textcontent

                     var timer=setTimeout("showticker()", speed)

              }

       }

       else {

              clearTimeout(timer)

              var timer=setTimeout("changetext()", textpause)

       }

}

 

function changetext() {

       i_substring=0

       i_presubstring=0

       i_text++

       i_textfontcolor++

       i_path++

       if (i_text>text.length-1) {i_text=0}

       if (i_textfontcolor>textfontcolor.length-1) {i_textfontcolor=0}

       showticker()

}

 

function changeform() {

       if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}

       if (i_textfontcolor >= textfontcolor.length) {i_textfontcolor=0}

       if (i_shadowcolor >= shadowcolor.length) {i_shadowcolor=0}

       if (i_path>path.length-1) {i_path=0}

       document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]

       document.getElementById('fillid').color=textfontcolor[i_textfontcolor]

       document.getElementById('shadowid').color=shadowcolor[i_shadowcolor]

       if (i_shape==path.length) {

              document.getElementById('shapeid').path=path[i_path]

       }

       if (i_message < text.length) {

              tick()

       }

       else {i_message=0;tick()}

}

 

function tick() {

       if (i_messagelength <= text[i_message].length) {

      

              var messagestringend=""

              var messagestring=text[i_message].substring(0, i_messagelength)+messagestringend

              document.getElementById('textpathid').string=messagestring

              var timer=setTimeout("tick()",speed)

              i_messagelength++

       }

       else {

              clearTimeout(timer)      

              var timer=setTimeout("prechangeform()",textpause)

       }

}

 

function prechangeform() {

       i_messagelength=0

       i_message++

       i_outlinecolor++   

       i_textfontcolor++  

       i_shadowcolor++   

       i_path++

       changeform()

}

 

function openlink() {

       if (texttarget[i_message]=="_blank") {

              codepopup=window.open(textlink[i_message], "code", "status=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,width=770,height=460,top=10,left=10");

       }

       else if (texttarget[i_message]=="_top") {

              top.location.href=textlink[i_text]

       }

       else if (texttarget[i_message]=="_parent") {

              parent.location.href=textlink[i_text]

       }

       else if (texttarget[i_message]=="_self") {

              document.location.href=textlink[i_text]

       }

       else {

              var jumpto=eval("parent."+texttarget[i_text])

              jumpto.location.href=textlink[i_text]

       }

}

 

if (ie5) {

       document.write('<div ID="roof" style="position:relative;width:'+textwidth+'px;height:'+textheight+'px;border-style:solid;border-width:'+funtickerborder+'px;border-color:'+funtickerbordercolor+';background-color:'+textbgcolor+';cursor:hand" onClick="openlink()">')

       document.write('<v:shapetype id="shapeid" coordsize="600,320" path="'+path[i_shape]+'">')

       document.write('<v:path textpathok="t"/>')

       document.write('<v:textpath on="t" fitshape="t" xscale="t"/>')

       document.write('</v:shapetype>')

       document.write('<v:shape type="#shapeid" style="position:absolute; top:3px; left:'+posleft+'px; width:'+innerwidth+'px;height:'+innerheight+'px;" strokeweight="1pt">')

       if (applygradient) {

              document.write('<v:fill id="fillid" method="linear sigma" type="gradient" color="'+textfontcolor[i_textfontcolor]+'" opacity="'+fontopacity+'"/>')

       }

       else {

              document.write('<v:fill id="fillid" color="'+textfontcolor[i_textfontcolor]+'" opacity="'+fontopacity+'"/>')

       }

       document.write('<v:stroke id="strokeid" weight="'+widthfontoutline+'pt" color="'+outlinecolor[i_outlinecolor]+'"/>')

 

       document.write('<v:shadow on="t" id="shadowid" opacity="'+shadowopacity+'" color="'+shadowcolor[i_shadowcolor]+'"/>')

       document.write('<v:textpath id="textpathid" style="font-family:\''+textfont+'\';v-text-kern:t" trim="t" fitpath="t" xscale="f" string="Hello World"/>')

 

       document.write('</v:shape>')

       document.write('</div>')

}

 

 

if (ns6 || opera) {

       if (ns6) {

              textwidth-=2*funtickerborder

              textheight-=2*funtickerborder

       }

       document.write('<div ID="roof" style="position:relative;width:'+textwidth+'px;height:'+textheight+'px;border-style:solid;border-width:'+funtickerborder+'px;border-color:'+funtickerbordercolor+';background-color:'+textbgcolor+'">')

       document.write('<span ID="ticker" style="position:absolute;top:0px;left:0px;width:'+innerwidth+'px;height:'+innerheight+'px;"></span>')

       document.write('</div>')

}

 

if (ie5) {window.onload=changeform}

if (opera) {window.onload=showticker}

if (ns6) {window.onload=showtickerNS6}

</script>

</td></tr></table>

 

0 Comments

Thu

26

Feb

2009

209、太酷了!模仿3D的消息

209、太酷了!模仿3D的消息

1把如下代码复制到<head></head>之间

 

 

<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>

<style type="text/css">

v\:* { behavior: url(#default#VML); }

</style>

 

 

2把如下代码复制到<body></body>之间

 

 

<h3>

  <script type="text/javascript">

 

// Add as many messages as you like

var message=new Array("网页特效", "尽在网页特效集锦code.xinnew.com", "背景特效", "按钮特效")

 

// Set the outline-color. Add as many colors as you like

var outlinecolor=new Array("black", "black")

 

// Set fillcolors 1. Add as many colors as you like

var fillcolor1=new Array("gray", "green", "white", "green")

 

// Set fillcolors 2. Add as many colors as you like

var fillcolor2=new Array("blue", "olive", "black", "lime")

 

// Set the letter marking the circle

var circlemark=new Array("-")

 

// Set the width of the outline

var strkweight=2

 

// Set the waiting time between the messages (seconds)

var pause=2

 

// Set the strength of the opacity (transparency of letters)

var strengthopacity="60%"

 

// Set the size of the circle (values range from 0.1 to 1)

var circlesize=0.5

 

// Always keep messages in view even if page is scrolled? (DD added option)

var keepinview="yes"

 

// Do not edit below this line

 

function ietruebody(){ //Dynamicdrive added function

return (document.compatMode!="BackCompat")? document.documentElement : document.body

}

 

var outerwidth=ietruebody().clientWidth

var outerheight=ietruebody().clientHeight

 

var innerwidth=Math.floor(circlesize*outerwidth)

var innerheight=Math.floor(circlesize*outerheight)

 

var posleft=(outerwidth-innerwidth)/2

var postop=(outerheight-innerheight)/2

 

var path=new Array()

var i_message=0

var i_outlinecolor=0

var i_fillcolor1=0

var i_fillcolor2=0

var i_messagelength=0

var longestmessage=0

pause*=1000

 

var ie=document.getElementById&&document.all?1:0

 

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

       if (message[i].length>longestmessage) {

              longestmessage=message[i].length

       }

       longestmessage+=4

}

 

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

 

       var emptyspace=""

       var i_emptyspace=(longestmessage-message[i].length)/2

       for (ii=0;ii<=i_emptyspace;ii++) {

              emptyspace+=circlemark

       }

       message[i]=emptyspace+" "+message[i]+" "+emptyspace

}

 

function changeform() {

       if (keepinview=="yes") //DD added

       document.getElementById("roofid").style.top=ietruebody().scrollTop //DD added

       if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}

       if (i_fillcolor1 >= fillcolor1.length) {i_fillcolor1=0}

       if (i_fillcolor2 >= fillcolor2.length) {i_fillcolor2=0}

       document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]

       document.getElementById('fillid').color=fillcolor1[i_fillcolor1]

       document.getElementById('fillid').color2=fillcolor2[i_fillcolor2]

       if (i_message < message.length) {tick()}

       else {document.getElementById('textpathid').string=""

       document.getElementById("roofid").style.display="none" //DD added

       }

}

 

function tick() {

       if (i_messagelength <= message[i_message].length) {

              var messagestringend=""

              var messagestring=message[i_message].substring(0, i_messagelength)+messagestringend

              document.getElementById('textpathid').string=messagestring

              var timer=setTimeout("tick()",50)

              i_messagelength++

       }

       else {

              clearTimeout(timer)

              i_messagelength=0

              i_message++

              i_outlinecolor++   

              i_fillcolor1++

              i_fillcolor2++

              var timer=setTimeout("changeform()",pause)

       }

      

}

 

if (ie) {

       document.write('<div id="roofid" style="position:absolute;left:0px;top:0px;width:'+outerwidth+'px;height:'+outerheight+'px;overflow:hidden;">')

       document.write('<v:oval id="tc" style="position:absolute;top:'+postop+'px;left:'+posleft+'px;width:'+innerwidth+'px;height:'+innerheight+'px">')

       document.write('<v:shadow on="t" opacity="'+strengthopacity+'"/>')

       document.write('<v:stroke id="strokeid" weight="'+strkweight+'pt" color="blue"/>')

       document.write('<v:fill id="fillid" on="True" color="'+fillcolor1[0]+'" color2="'+fillcolor2[0]+'" opacity="'+strengthopacity+'" opacity2="'+strengthopacity+'" type="gradient"/>')

       document.write('<v:path textpathok="t"/>')

       document.write('<v:textpath id="textpathid" on="t" id="mytp" style="font-family:\'Arial Black\'; " fitpath="t" string=""/>')

       document.write('</v:oval></div>')

       if (window.attachEvent) //DD added code

       window.attachEvent("onload", changeform) //DD added code

       else

       window.onload=changeform

}

</script></h3>

 

0 Comments

Thu

26

Feb

2009

208、随机信息显示

208、随机信息显示

脚本说明:

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

<script language="JavaScript">

<!-- Hide

var a = Math.random() + ""

var rand1 = a.charAt(5)

quotes = new Array

quotes[1] = '文本信息一'

quotes[2] = '文本信息二'

quotes[3] = '文本信息三'

quotes[4] = '文本信息四'

quotes[5] = '文本信息五'

quotes[6] = '文本信息六'

quotes[7] = '文本信息七'

quotes[8] = '文本信息八'

quotes[9] = '文本信息九'

quotes[0] = '文本信息十'

var quote = quotes[rand1]

//-->

</script>

                    <script language="JavaScript">

<!-- Hide

document.write( quote )

// -->

</script>

 

0 Comments

Thu

26

Feb

2009

207、随机文本链接

207、随机文本链接

脚本说明:

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

<script language="JavaScript">

<!--Hide from non JavaScript browsers

an = 3

var ran = Math.random();

var talet = Math.round(ran * (an-1))+1;

function create() {

        this.src = ''

      

}

 

b = new Array()

for(var i=1; i<=an; i++) { b[i] = new create() }

 

b[1].src    = "<a href='http://www.7stk.com'>"

b[2].src    = "<a href='http://www.263.net'>"

b[3].src    = "<a href='http://www.163.com'>"

var vis = "";

vis += b[talet].src;

//-->

</script>

                  <script language="JavaScript">

<!--

document.write(vis+"随机文本链接"+"</a>");

//-->

</script>

 

0 Comments

Thu

26

Feb

2009

206、所有链接不停变色

206、所有链接不停变色

脚本说明:

 

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

 

<script language="JavaScript">

 

<!-- Begin

 

function initArray() {

 

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

 

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

 

}

 

this.length = initArray.arguments.length;

 

}

 

var colors = new initArray(

 

"red",

 

"blue",

 

"green",

 

"purple",

 

"black",

 

"tan",

 

"red");

 

delay = .5; // seconds

 

link = 0;

 

vlink = 0;

 

function linkDance() {

 

link = (link+1)%colors.length;

 

vlink = (vlink+1)%colors.length;

 

document.linkColor = colors[link];

 

document.vlinkColor = colors[vlink];

 

setTimeout("linkDance()",delay*1000);

 

}

 

linkDance();

 

// End -->

 

</script>

 

 

 

  <br>

 

       <a href="http://www.263.net">首都在线</a> <a href="http://www.7stk.com">网页特效代码</a>

 

                  <a href="http://www.163.net">163电子邮局</a> <a href="http://www.sina.com.cn">新浪网</a>

 

 

1 Comments

Thu

26

Feb

2009

205、鼠标经过文字变色

205、鼠标经过文字变色

脚本说明:

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

<p onMouseMove="hello()">鼠标经过时就会变色的文本</p>

                  <script language="VBScript">

sub hello

document.fgColor=int(256*256*256*rnd)

end sub

</script>

 

0 Comments

Thu

26

Feb

2009

204、文字颜色渐变脚本

204、文字颜色渐变脚本

脚本说明:

 

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

 

<script language="JavaScript">

 

 

 

<!-- Hide

 

 

 

 

 

 

 

function MakeArray(n){

 

 

 

   this.length=n;

 

 

 

   for(var i=1; i<=n; i++) this[i]=i-1;

 

 

 

   return this

 

 

 

}

 

 

 

 

 

 

 

hex=new MakeArray(16);

 

 

 

hex[11]="A"; hex[12]="B"; hex[13]="C"; hex[14]="D"; hex[15]="E"; hex[16]="F";

 

 

 

 

 

 

 

function ToHex(x){

 

 

 

   var high=x/16;

 

 

 

   var s=high+"";

 

 

 

   s=s.substring(0,2); 

 

 

 

   high=parseInt(s,10);

 

 

 

   var left=hex[high+1];

 

 

 

   var low=x-high*16;

 

 

 

   s=low+"";

 

 

 

   s=s.substring(0,2);

 

 

 

   low=parseInt(s,10);

 

 

 

   var right=hex[low+1];

 

 

 

   var string=left+""+right;

 

 

 

   return string;

 

 

 

}

 

 

 

 

 

 

 

function rainbow(text){

 

 

 

   text=text.substring(3,text.length-4);

 

 

 

   color_d1=255;                               

 

 

 

   mul=color_d1/text.length;

 

 

 

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

 

 

 

      color_d1=255*Math.sin(i/(text.length/3)); "255*Math.sin(i/(text.length/3))"

 

 

 

      color_h1=ToHex(color_d1);

 

 

 

      color_d2=mul*i;

 

 

 

      color_h2=ToHex(color_d2);

 

 

 

      document.write("<FONT COLOR='#FF"+color_h1+color_h2+"'>"+text.substring(i,i+1)+'</FONT>');

 

 

 

   }

 

 

 

}

 

 

 

 

 

 

 

// -->

 

 

 

</script>

 

 

 

<SCRIPT>

 

 

 

<!--

 

 

 

   {rainbow("--> YOUR MESSAGE GOES HERE. THE LONG THE BETTER!<!--");}

 

 

 

//-->

 

 

 

</SCRIPT>

 

 

0 Comments

Thu

26

Feb

2009

203、文字特效

203、文字特效

脚本说明:

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

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: blur(add=1, direction=45, strength=3)">Welcome You</div>

 

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: glow(color=ffff00, strength=5)"> Welcome You</div>

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: dropshadow(color=000000, offx=3, offy=3, positive=1)"> Welcome You</div>

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: yellow; position: relative; filter: invert"> Welcome You</div>

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: xray"> Welcome You</div>

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: fliph">Welcome You</div>

 

 

<div style="width: 350; font-size:15pt; font-family: Arial ; color: red; position: relative; filter: flipv"> Welcome You</div>

 

 

0 Comments

Thu

26

Feb

2009

202、文字不停变色

202、文字不停变色

脚本说明:

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

<SCRIPT language=JavaScript1.2>

<!-- Begin

function initArray() {

this.length = initArray.arguments.length;

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

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

   }

}

var ctext = "你好!欢迎您的光临,留下你宝贵意见!!!";

var speed = 2000;

var x = 0;

var color = new initArray(

"#ffff00",

"#ff0000",

"#ff00ff",

"#0000ff",

"#ffffff",

"#000000",

"#00ff00",

"#00ffff",

"#ff0ff0"

);

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

document.write('<layer id="c"><center>'+ctext+'</center></layer><br>');

}

if (navigator.appVersion.indexOf("MSIE") != -1){

document.write('<div id="c"><center><b>'+ctext+'</b></center></div>');

}

function chcolor(){

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

document.c.document.write('<center><font color="'+color[x]);

document.c.document.write('">'+ctext+'</font></center>');

document.c.document.close();

}

else if (navigator.appVersion.indexOf("MSIE") != -1){

document.all.c.style.color = color[x];

}

(x < color.length-1) ? x++ : x = 0;

}

setInterval("chcolor()",1000);

// End -->

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

201、精彩变色文字

201、精彩变色文字

脚本说明:

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

 <SCRIPT>

 

messages = new Array()

messages[0] = "你好,最近忙吗?"

messages[1] = "欢迎你的到来"

messages[2] = "请多呆一会"

messages[3] = "你一定会有所收获的"

messages[4] = "Netscape Navigator不太支持这个"

 

mescolor = new Array()

mescolor[0] = "000000"

mescolor[1] = "FF0000"

mescolor[2] = "008800"

mescolor[3] = "0000FF"

mescolor[4] = "888800"

 

messize = new Array()

messize[0] = "30pt"

messize[1] = "40pt"

messize[2] = "50pt"

messize[3] = "30pt"

messize[4] = "20pt"

 

var i_messages = 0

var timer

 

function dotransition() {

    if (document.all) {

        content.filters[0].apply()

        content.innerHTML = "<span style='color:"+mescolor[i_messages]+";font-size:"+messize[i_messages]+";filter: revealTrans(Transition=12, Duration=3)'>"+messages[i_messages]+"</span>"

        content.filters[0].play()

        if (i_messages >= messages.length-1) {

            i_messages = 0

        }

        else {

            i_messages++

        }

    }

   

    if (document.layers) {

       document.content.document.write("<span style='color:"+mescolor[i_messages]+"'>"+messages[i_messages]+"</span>")

        if (i_messages >= messages.length-1) {

            i_messages = 0

        }

        else {

            i_messages++

        }

    }

    timer = setTimeout("dotransition()",5000)  

}

 

</SCRIPT>

 

 

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

<DIV id=content

style="FILTER: revealTrans(Transition=12, Duration=2); HEIGHT: 200px; LEFT: 93px; POSITION: absolute; TEXT-ALIGN: center; TOP: 21px; WIDTH: 559px"></DIV>

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

200、文字动态变化

200、文字动态变化

脚本说明:

 

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

 

<SCRIPT language=JavaScript><!-- Begin

 

var speed = 20;

 

var cycledelay = 1000;

 

var maxsize = 48;

 

 

 

var x = 0;

 

var y = 0;

 

var themessage, size;

 

var esize = "";

 

 

 

function initArray() {

 

this.length = initArray.arguments.length;

 

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

 

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

 

   }

 

}

 

var themessage2 = new initArray(

 

"欢迎访问......",

 

"网页之作.....",

 

"冰峰工作室向你问好.....!",

 

"谢谢你的访问....."

 

);

 

if(navigator.appName == "Netscape")

 

document.write('<layer id="wds"></layer><br>');

 

if (navigator.appVersion.indexOf("MSIE") != -1)

 

document.write('<span id="wds"></span><br>');

 

function upwords(){

 

themessage = themessage2[y];

 

if (x < maxsize) {

 

x++;

 

setTimeout("upwords()",speed);

 

}

 

else setTimeout("downwords()",cycledelay);

 

 

 

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

 

size = "<font point-size='"+x+"pt'>";

 

document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);

 

document.wds.document.close();

 

}

 

if (navigator.appVersion.indexOf("MSIE") != -1){

 

wds.innerHTML = "<center>"+themessage+"</center>";

 

wds.style.fontSize=x+'px'

 

   }

 

}

 

function downwords(){

 

if (x > 1) {

 

x--;

 

setTimeout("downwords()",speed);

 

}

 

else {

 

setTimeout("upwords()",cycledelay);

 

y++;

 

if (y > themessage2.length - 1) y = 0;

 

}

 

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

 

size = "<font point-size='"+x+"pt'>";

 

document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);

 

document.wds.document.close();

 

}

 

if (navigator.appVersion.indexOf("MSIE") != -1){

 

wds.innerHTML = "<center>"+themessage+"</center>";

 

wds.style.fontSize=x+'px'

 

   }

 

}

 

setTimeout("upwords()",speed);

 

//  End -->

 

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

199、字符满天飞舞的特效

199、字符满天飞舞的特效

<html>

<head><title>字符飞舞</title>

<script language="JavaScript">

<!--

 

//下面是在屏幕上飞的字

var message = "welcom";

 

//下面是字飞过后出现的正文

var finalmessage = "<a href=text111.htm>看源代码</a>";

 

/*--------------------------------------------------------------------------*/

/*以下的可选择使用*/

 

//下面是飞字的条数,取1--10之间,本页取的是10

var noOfFlyers = 10;

 

//下面是每条飞字的颜色,注意:条数是多少,即对应几条颜色

var blkCol = new Array("black","blue","red","green","blue","blue","red","black","red","green");

 

//下面是每条飞字的字体,注意:条数是多少,即对应几条字体

var blkFont = new Array("arial","timesroman","courier","verdana","timesroman","courier","arial","timesroman","courier","verdana");

 

//下面是每条飞字的大小,建议在10-32之间,注意:条数是多少,即对应几条大小

var blkSize = new Array("22","14","10","28","29","10","22","24","26","10");

 

//下面是定义每条飞字是否斜体,注意:条数是多少,即对应几条信息

var blkIt = new Array("0","0","1","0","0","1","1","0","1","1");

 

/*--------------------------------------------------------------------------*/

/*请不要轻易修改以下代码*/

 

var ie=document.all?1:0

var ns=document.layers?1:0

var err = 0;

 

var msgI=1;

var noOfMsgs;

 

function initialize()

{

       if(!ns&&!ie) {

              document.writeln("<center>"+finalmessage+"</center>");

              document.writeln("<P><P><font face='arial' size=2>You are missing out on all the coolest stuff because of your outdated browser. Upgrade soon.</font>");

              err=1;

              return;

              }

 

       if(noOfFlyers<1||noOfFlyers>10) {handleErr("The number of flying blocks has been assigned an invalid value. Script will terminate.");return}

       if(blkCol.length!=noOfFlyers) {handleErr("The list of block colours has an invalid length. Script will terminate.");return}

       if(blkFont.length!=noOfFlyers) {handleErr("The list of block fonts has an invalid length. Script will terminate.");return}

       if(blkSize.length!=noOfFlyers) {handleErr("The list of block font sizes has an invalid length. Script will terminate.");return}

 

       self.moveTo(0,0);

       self.resizeTo(screen.width,screen.height);

 

       var msg = new String(message);

       aOMsgs = msg.split(" ");

       noOfMsgs = aOMsgs.length+1;

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

       {

              for(var j = 1; j<=noOfFlyers; j++)

              {

                     if(ie) document.writeln("<div id=\"fly"+String((i*noOfFlyers)+j)+"\" class=\"fly"+String(j)+"\" style=\"visibility:hidden\">"+aOMsgs[i]+"</div>");

                     if(ns) document.writeln("<layer id=\"fly"+String((i*noOfFlyers)+j)+"\" class=\"fly"+String(j)+"\" visibility=\"hidden\">"+aOMsgs[i]+"</layer>");

              }

       }

 

       if(ie) document.write("<div id=\"mesg\" style=\"position:relative;color:black;visibility:hidden;font-family:arial;\"><center>"+finalmessage+"</center></div>");

       if(ns) document.write("<layer id=\"mesg\" class=\"mesg\" visibility=\"hidden\"><center>"+finalmessage+"</center></layer>");

 

}

 

var msgCol=0;

function stop_flying()

{

       if(ie){

              document.all.mesg.style.visibility="visible";

              document.all.mesg.style.color="rgb("+String(msgCol)+","+String(msgCol)+","+String(msgCol)+")";

             }

       if(ns){

              setTimeout("document.layers['mesg'].visibility='visible'",1000);

              return;

             }

             

       msgCol+=10;

       if(msgCol<256) setTimeout("stop_flying()",10);

       else return;

}

function fly_txt(dataID)

{

       this.objID = dataID;

 

       var screen_x = screen.width;

       var screen_y = screen.height;

      

       var window_x = 0.9*screen_x;

       var window_y = 0.6*screen_y;

       var x;

       x=0.6*Math.random();

       if(x>0.3) x+=0.4;

      

       this.start_x = Math.round(window_x*x);

       this.start_y = Math.round(window_y*Math.random());

      

       if(x>0.3) x=0.3*Math.random();

       else x=0.7+0.3*Math.random();

      

       this.stop_x = Math.round(window_x*x);

       this.stop_y = Math.round(window_y*Math.random());

             

        this.slope = (this.stop_y - this.start_y)/(this.stop_x - this.start_x);

             

       this.speed = Math.round(Math.random()*2)+4;

       if(ns) this.speed-=2;

       this.steps = Math.round(Math.abs(this.start_x-this.stop_x)/this.speed);

 

       this.curCol = 0;

       this.curI = 0;

       this.timerID = 0;

      

       if(ie) this.objStyle = eval("document.all(\""+this.objID+"\").style");

       if(ns) this.objStyle = eval("document.layers[\""+this.objID+"\"]");

 

       var tmp = (parseInt(dataID.substring(3))-1)%noOfFlyers;

 

       if(ie) {

              this.color=blkCol[tmp];

              this.objStyle.fontFamily=blkFont[tmp];

              this.objStyle.fontSize=blkSize[tmp]+"pt";

              this.objStyle.fontStyle=(parseInt(blkIt[tmp])?"italic":"normal");

 

}

      

       this.Animate = animate_fly;

 

 

}

 

function animate_fly()

{

      

       if(ie){

              this.objStyle.pixelLeft = this.start_x+this.curI;

              this.objStyle.pixelTop = (this.slope*this.curI) + this.start_y;

              }

       if(ns){

              this.objStyle.left = this.start_x+this.curI;

              this.objStyle.top = (this.slope*this.curI) + this.start_y;

              }

       this.objStyle.visibility="visible";

       if(this.stop_x>this.start_x) this.curI+=this.speed;

       else this.curI-=this.speed;

       if(ie){

       var tmp;

       switch(this.color){

      

              case "white":

              tmp=String("rgb("+String(this.curCol)+","+String(this.curCol)+","+String(this.curCol)+")");

              break;

             

              case "red":

              tmp=String("rgb("+String(this.curCol)+",0,0)");

              break;

             

              case "blue":

              tmp=String("rgb(0,0,"+String(this.curCol)+")");

              break;

 

              case "green":

              tmp=String("rgb(0,"+String(this.curCol)+",0)");

              break;

 

              default:

              }

        this.objStyle.color=tmp;

       if(this.steps>50){

       if(Math.abs(this.curI/this.speed)<25) this.curCol+=10;

       if(Math.abs(this.curI/this.speed)>(this.steps-25)) this.curCol-=5;

      

       }

       }

       if(Math.abs(this.start_x+this.curI-this.stop_x)<=this.speed) {

              clearInterval(this.timerID);

              this.timerID=0;

              this.objStyle.visibility="hidden";

              var end=0;

              for(var i=1; i<=noOfFlyers; i++)

                     if(fly[i].timerID) end=1;

              if(!end)

                     if(msgI<noOfMsgs) start_flying(msgI++);

                     else stop_flying();

      

       }

      

}

 

var fly = new Array(11);

function start_flying(msgIndex)

{

       if(err) return;

        for(var s=1; s<=noOfFlyers; s++)

       {

              fly[s] = new fly_txt("fly"+String((msgIndex-1)*noOfFlyers+s));

       }

 

 

       for(s=1;s<=noOfFlyers;s++)

       {

              var cmd = "fly["+s+"].Animate()";

              fly[s].timerID = setInterval(cmd,10);

       }

 

}

 

function handleErr(errMsg)

{

       alert(errMsg);

       err=1;

       return false;

}

//-->

</script>

<style type="text/css">

<!--

.fly1 {position:absolute;font-family:arial;font-size:22pt;font-weight:bold;color:white;}

.fly2 {position:absolute;font-family:timesroman;font-size:24pt;font-weight:bold;color:white;}

.fly3 {position:absolute;font-family:gothic;font-size:26pt;font-weight:bold;color:white;}

.fly4 {position:absolute;font-family:arial;font-size:28pt;font-weight:bold;color:white;}

.fly5 {position:absolute;font-family:courier;font-size:29pt;font-weight:bold;color:white;}

.fly6 {position:absolute;font-family:arial;font-size:22pt;font-weight:bold;color:white;}

.fly7 {position:absolute;font-family:timesroman;font-size:20pt;font-weight:bold;color:white;}

.fly8 {position:absolute;font-family:gothic;font-size:22pt;font-weight:bold;color:white;}

.fly9 {position:absolute;font-family:arial;font-size:24pt;font-weight:bold;color:white;}

.fly10 {position:absolute;font-family:courier;font-size:25pt;font-weight:bold;color:white;}

.mesg {position:relative;color:white;font-family:arial;}

-->

</style>

<style type="text/javascript">

for(var k = 1; k<=noOfFlyers; k++){

       document.classes["fly"+String(k)].all.color=blkCol[k-1];

       document.classes["fly"+String(k)].all.fontFamily=blkFont[k-1];

       document.classes["fly"+String(k)].all.fontSize=blkSize[k-1]+"pt";

       document.classes["fly"+String(k)].all.fontStyle=(parseInt(blkIt[k-1])?"italic":"normal");

}

</style>

</head>

<body bgcolor="#ffffff" text="#000000" onLoad="start_flying(msgI++)">

<script language = "JavaScript">

<!--

 

initialize();

 

//-->

</script>

</body>

</html>

0 Comments

Thu

26

Feb

2009

198、文字特殊显示

198、文字特殊显示

脚本说明:

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

<script language="JavaScript">

<!--

 

 

IE4 = navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4;  

NS4 = navigator.appName.substring(0,8) == "Netscape" && parseInt(navigator.appVersion) >= 4;

      

// checkBrowser() -- Checks whether the browser is new enough for some DynamicMovement ...

 

function checkBrowser(){

       if(IE4 || NS4){

              return true;

       }

       return false;

}

 

// movableObj() -- Creates a new movable object

 

function movableObj(startX, startY, endX, endY, delay, speed, refId){

       this.sX = startX; this.sY = startY;  this.eX = endX;

       this.eY = endY;      this.de = delay; this.sp = speed;

       this.ref = refId;

       xL = endX - startX;

       yL = endY - startY;

       with (Math){

              if(abs(xL) > abs(yL)){

                     this.xS = (xL > 0)?1:-1;

                     this.yS = (yL > 0)?abs(yL / xL):-abs(yL / xL);

                     this.howManySteps = abs(xL / speed);

              } else if(abs(yL) > abs(xL)){

                     this.yS = (yL > 0)?1:-1;

                     this.xS = (xL > 0)?abs(xL / yL):-abs(xL / yL);

                     this.howManySteps = abs(yL / speed);

              } else {

                     this.yS = (yL > 0)?1:-1;

                     this.xS = (xL > 0)?1:-1;

                     this.howManySteps = abs(xL / speed);

              }

       }

       this.startMovement = startMovement;

}

 

// startMovement() -- starts the movement

 

function startMovement(){

       if(checkBrowser()){

              if(IE4){

                     ref = document.all(this.ref).style;

              } else {

                     ref = document[this.ref];

              }

              doDynamicMovement(this.sX, this.sY, this.eX, this.eY, this.de, this.xS, this.yS, ref, this.sp, this.howManySteps);

       }

}

 

// doDynamicMovement() -- does the Dynamic Movement

 

function doDynamicMovement(curX, curY, eX, eY, sp, xS, yS, ref, speed, hS){

       if(Math.floor(hS - 1) != 0){

              hS--;

              curX += xS * speed;

              curY += yS * speed;

              ref.left = Math.round(curX);

              ref.top = Math.round(curY);

              setTimeout("doDynamicMovement(" + curX + ", " + curY + ", " + eX + ", " + eY + ", " + sp + ", " + xS + ", " + yS + ", ref, " + speed + ", " + hS + ")", sp);

       } else {

              setPos(eX, eY, ref);      

 

       }

}

 

// setPos() -- sets the end position accurately when doDynamicMovement has done its job

 

function setPos(x, y, ref){

       ref.left = x;

       ref.top = y;

}

 

// -->

</script>

 

 

<table width="600">

  <tr>

    <td><font face="Verdana, Arial"><h3>  </h3>

    <font size="2"><form>

      <div align="center"><center><p><input type="button" onClick="dynaText.startMovement()"

      value="按下去看看"> </p>

      </center></div>

    </form>

    <p>  </font></p>

    <div id="wow"

    style="position: absolute; left: -100; top: -100; width: 300;

              font-family: Verdana, Arial; font-size: 20pt"><p>欢迎光临网页特效代码!

    </font></p></font></td>

  </tr>

</table>

<script language="JavaScript">

<!--

 

// Here we define the movable object

dynaText = new movableObj(-100,-100,80,180,10,10,"wow");

 

// -->

</script>

 

0 Comments

Thu

26

Feb

2009

197、字符滚动隐现效果

197、字符滚动隐现效果

脚本说明:

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

<style type="text/css">

<!--

.textanimlink,a {

text-decoration : none;

}

P.main {

       font-family : Arial;

       font-size : 15pt;

       font-weight : bold;

}

-->

</style>

<!--IENS都适用于 -->

<script language="Javascript">

<!-- Hiding

 

bname=navigator.appName;

bversion=parseInt(navigator.appVersion)

if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4))

window.onload=start

else

stop();

window.onunload=stop

if (bname=="Netscape"){

brows=true

dt=2

}

else{

brows=false

dt=20

}

var z=0;

var msg=0;

var rgb=0;

var link=false;

var status=true;

var updwn=false;

var message= new Array();

var value=0;

var h=window.innerHeight;

var w=window.innerWidth;

var timer1;

var timer2;

var timer3;

var convert = new Array()

var hexbase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");

 

// 改变下面的一些参数,其余的不要改变。

var bgcolor="#FFFFFF"; //背景色

var color="#00008D";  //字符颜色

 

//随便添加更多的显示信息。

 

message[0]='显示的字符'

message[1]='显示的字符'

message[2]='显示的字符'

message[3]='<a href="http://www.k688.com">网络时空</a>'

 

//可以使用超级连接语句。

// 以上的参数需要做一些设置

 

for (x=0; x<16; x++){

for (y=0; y<16; y++){

convert[value]= hexbase[x] + hexbase[y];

value++;

}

}

 

redx=color.substring(1,3);

greenx=color.substring(3,5);

bluex=color.substring(5,7);

hred=eval(parseInt(redx,16));

hgreen=eval(parseInt(greenx,16));

hblue=eval(parseInt(bluex,16));

eredx=bgcolor.substring(1,3);

egreenx=bgcolor.substring(3,5);

ebluex=bgcolor.substring(5,7);

ered=eval(parseInt(eredx,16));

egreen=eval(parseInt(egreenx,16));

eblue=eval(parseInt(ebluex,16));

red=ered;

green=egreen;

blue=eblue;

 

function start(){

if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4)){

link=false;

updwn=true;

if (brows)

res=document.layers['textanim'].top

else{

textanim.style.width=document.body.offsetWidth-20;

textanim.innerHTML='<Pre><P Class="main" Align="Center">'+message[msg]+'</P></Pre>'

res=textanim.style.top

for (x=0; x<document.all.length; x++)

if(document.all[x].id=="textanimlink")

link=true;

}

up()

}

}

 

function stop(){

clearTimeout(timer1);

clearTimeout(timer2);

clearTimeout(timer3);

}

 

function resz(){

h=window.innerHeight;

w=window.innerWidth;

if (updwn)

timer1=setTimeout('up()',1000)

else

timer2=setTimeout('down()',1000)

}

 

function breakf(){

if (status){

clearTimeout(timer1);

clearTimeout(timer2);

status=false

return;

}

else{

status=true;

if (updwn)

timer1=setTimeout('up()',dt)

else

timer2=setTimeout('down()',dt)

}

}

 

 

function up(){

if (red<hred){

if ((red+7)<hred)

red+=7;

else

red=hred

redx = convert[red]

}

else{

if ((red-7)>hred)

red-=7;

else

red=hred

redx = convert[red]

}

 

if (green<hgreen){

if ((green+7)<hgreen)

green+=7;

else

green=hgreen

greenx = convert[green]

}

else{

if ((green-7)>hgreen)

green-=7;

else

green=hgreen

greenx = convert[green]

}

 

if (blue<hblue){

if ((blue+7)<hblue)

blue+=7;

else

blue=hblue

bluex = convert[blue]

}

else{

if ((blue-7)>hblue)

blue-=7;

else

blue=hblue

bluex = convert[blue]

}

 

rgb = "#"+redx+greenx+bluex;

if (brows){

document.layers['textanim'].document.linkColor=rgb;

document.layers['textanim'].document.vlinkColor=rgb;

if (window.innerHeight!=h || window.innerWidth!=w){

clearTimeout(timer1);

resz()

return;

}

else{

document.layers['textanim'].document.write('<Pre><P Class="main" Align="Center"><font color="'+rgb+'">'+message[msg]+'</font></P></Pre>')

document.layers['textanim'].document.close();

}

}

else{

textanim.style.color=rgb;

if(link)

textanimlink.style.color=rgb;

}

if (z<38){

if (brows)

document.layers['textanim'].top--

else

textanim.style.posTop--

z++

timer1=setTimeout('up()',dt)

}

else

{

updwn=false;

down()

}

}

 

 

function down(){

if (red<ered){

if ((red+7)<ered)

red+=7;

else

red=ered

redx = convert[red]

}

else{

if ((red-7)>ered)

red-=7;

else

red=ered

redx = convert[red]

}

 

if (green<egreen){

if ((green+7)<egreen)

green+=7;

else

green=egreen

greenx = convert[green]

}

else{

if ((green-7)>egreen)

green-=7;

else

green=egreen

greenx = convert[green]

}

 

if (blue<eblue){

if ((blue+7)<eblue)

blue+=7;

else

blue=eblue

bluex = convert[blue]

}

else{

if ((blue-7)>eblue)

blue-=7;

else

blue=eblue

bluex = convert[blue]

}

 

rgb = "#"+redx+greenx+bluex;

if (brows){

document.layers['textanim'].document.linkColor=rgb;

document.layers['textanim'].document.vlinkColor=rgb;

if (window.innerHeight!=h || window.innerWidth!=w){

clearTimeout(timer2);

resz()

return;

}

else{

document.layers['textanim'].document.write('<Pre><P Class="main" Align="Center"><font color="'+rgb+'">'+message[msg]+'</font></P></Pre>')

document.layers['textanim'].document.close();

}

}

else{

textanim.style.color=rgb;

if(link)

textanimlink.style.color=rgb;

}

 

if (z<76){

if (brows)

document.layers['textanim'].top--

else

textanim.style.posTop--

z++

timer2=setTimeout('down()',dt)

}

else

{

if (brows){

document.layers['textanim'].document.write('')

document.layers['textanim'].document.close();

}

else

textanim.innerHTML='';

window.clearInterval(timer2);

if(msg<message.length-1){

msg++;

z=0;

if (brows){

document.layers['textanim'].top=res;

}

else

textanim.style.top=res;

timer3=setTimeout('start()',100);

}

else

{

msg=0;

z=0;

if (brows)

document.layers['textanim'].top=res;

else

textanim.style.top=res;

timer3=setTimeout('start()',2000);

}

}

}

 

 

// done hiding -->

</script>

//改变绝对位置适应页面。

<div id="textanim" style="position: absolute; left: 0; top: 340" onClick="breakf()">

 

0 Comments

Thu

26

Feb

2009

196、链接文字特殊显示

196、链接文字特殊显示

脚本说明:

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

<style type="text/css">

<!--

.GlowFilter {filter : Glow(Color="#3300ff",Strength="10")}

.noglow {}

-->

</style>

 

 

 

 

 

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

<div ID="rollover1"

STYLE="height:10; font:bold 10pt Arial; color:#0080ff; cursor:hand;><a href=" #"

Onmouseover="rollover1.className='GlowFilter'" Onmouseout="rollover1.className='noglow'"

onclick="window.location='http://www.163.com';">

 

<p>网易</p>

</div>

 

<p><br>

</p>

<div ID="rollover2"

STYLE="height:10; font:bold 10pt Arial; color:#0080ff; cursor:hand;><a href=" #"

Onmouseover="rollover2.className='GlowFilter'" Onmouseout="rollover2.className='noglow'"

onclick="window.location='http://www.sina.com.cn';">

 

<p>新浪</p>

</div>

 

<p><br>

</p>

<div ID="rollover3"

STYLE="height:10; font:bold 10pt Arial; color:#0080ff; cursor:hand;><a href=" #"

Onmouseover="rollover3.className='GlowFilter'" Onmouseout="rollover3.className='noglow'"

onclick="window.location='http://www.sohu.com';">

 

<p>搜狐</p>

</div>

 

0 Comments

Thu

26

Feb

2009

195、文字从旁边出现

195、文字从旁边出现

脚本说明:

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

<script LANGUAGE="JavaScript" FPTYPE="mydynamicanimation">

<!--

  dynamicanimAttr = "mydynamicanimation"

  animateElements = new Array()

  currentElement = 0

  speed = 0

  stepsZoom = 8

  stepsWord = 8

  stepsFly = 12

  stepsSpiral = 16

  steps = stepsZoom

  step = 0

  outString = ""

  function mydynAnimation()

  {

    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))

      {

        for (index=document.layers.length-1; index >= 0; index--)

        {

            layer=document.layers[index]

            if (layer.left==10000)

                layer.left=0

        }

      }

      return

    }

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

    {

      el = document.all[index]

      animation = el.getAttribute(dynamicanimAttr, false)

      if(null != animation)

      {

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

        {

          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, "")

            if(i2 == iend)

              break

            i1 = i2

            i2 = endWord(ih, i1)

            if(i2 == -1)

              i2 = iend

            outWord(ih, i1, i2, true, animation)

            if(i2 == iend)

              break

            i1 = i2

          }

          document.all[index].innerHTML = outString

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

          document.all[index].setAttribute(dynamicanimAttr, null)

        }

        if(animation == "zoomIn" || animation == "zoomOut")

        {

          ih = el.innerHTML

          outString = "<SPAN " + dynamicanimAttr + "=\"" + animation + "\" style=\"position: relative; left: 10000;\">"

          outString += ih

          outString += "</SPAN>"

          document.all[index].innerHTML = outString

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

          document.all[index].setAttribute(dynamicanimAttr, null)

        }

      }

    }

    i = 0

    for (index=document.body.sourceIndex; index < document.all.length; index++)

    {

      el = document.all[index]

      animation = el.getAttribute(dynamicanimAttr, false)

      if (null != animation)

      {

        if(animation == "flyLeft")

        {

          el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth

          el.style.posTop = 0

        }

        else if(animation == "flyRight")

        {

          el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth

          el.style.posTop = 0

        }

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

        {

          el.style.posLeft = 0

          el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight

        }

        else if(animation == "flyBottom")

        {

          el.style.posLeft = 0

          el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight

        }

        else if(animation == "flyTopLeft")

        {

          el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth

          el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight

        }

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

        {

          el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth

          el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight

        }

        else if(animation == "flyBottomLeft")

        {

          el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth

          el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight

        }

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

        {

          el.style.posLeft = 10000-offsetLeft(el)+document.body.offsetWidth

          el.style.posTop = document.body.scrollTop-offsetTop(el)+document.body.offsetHeight

        }

        else if(animation == "spiral")

        {

          el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth

          el.style.posTop = document.body.scrollTop-offsetTop(el)-el.offsetHeight

        }

        else if(animation == "zoomIn")

        {

          el.style.posLeft = 10000

          el.style.posTop = 0

        }

        else if(animation == "zoomOut")

        {

          el.style.posLeft = 10000

          el.style.posTop = 0

        }

        else

        {

          el.style.posLeft = 10000-offsetLeft(el)-el.offsetWidth

          el.style.posTop = 0

        }

        el.initLeft = el.style.posLeft

        el.initTop = el.style.posTop

        animateElements[i++] = el

      }

    }

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

  }

  function offsetLeft(el)

  {

    x = el.offsetLeft

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

      x += e.offsetLeft;

    return x

  }

  function offsetTop(el)

  {

    y = el.offsetTop

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

      y += e.offsetTop;

    return y

  }

  function startWord(ih, i)

  {

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

    {

      c = ih.charAt(i)

      if(c == '<')

        tag = true

      if(!tag)

        return i

      if(c == '>')

        tag = false

    }

    return -1

  }

  function endWord(ih, i)

  {

    nonSpace = false

    space = false

    while(i < ih.length)

    {

      c = ih.charAt(i)

      if(c != ' ')

        nonSpace = true

      if(nonSpace && c == ' ')

        space = true

      if(c == '<')

        return i

      if(space && c != ' ')

        return i

      i++

    }

    return -1

  }

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

  {

    if(dyn)

      outString += "<SPAN " + dynamicanimAttr + "=\"" + anim + "\" style=\"position: relative; left: 10000;\">"

    outString += ih.substring(i1, i2)

    if(dyn)

      outString += "</SPAN>"

  }

  function animate()

  {

    el = animateElements[currentElement]

    animation = el.getAttribute(dynamicanimAttr, false)

    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)

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

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

    }

    else if(animation == "zoomIn")

    {

      steps = stepsZoom

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

      el.style.posLeft = 0

    }

    else if(animation == "zoomOut")

    {

      steps = stepsZoom

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

      el.style.posLeft = 0

    }

    else

    {

      steps = stepsFly

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

        steps = stepsWord

      dl = el.initLeft / steps

      dt = el.initTop  / steps

      el.style.posLeft = el.style.posLeft - dl

      el.style.posTop = el.style.posTop - dt

    }

    if (step >= steps)

    {

      el.style.posLeft = 0

      el.style.posTop = 0

      currentElement++

      step = 0

    }

    if(currentElement < animateElements.length)

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

  }

//-->

</script>

 

 

 

 

 

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

<p align="center" mydynamicanimation="flyTopRightWord"

style="position: relative !important; left: 10000 !important"><strong><big><big><font

face="Arial">欢迎光临<a href="http://www.7stk.com">网页特效代码</a> 谢谢!</font></big></big></strong></p>

 

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

194、文本从右向左输出

194、文本从右向左输出

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript1.2">

 

<!-- Begin

var l1 =   0; // left of ticker in pixel, or 0 to position relative

var t1 =   0; // top of ticker in pixel, or 0 to position relative

var w1 = 400; // width of ticker in pixel

var ie = document.all ? true : false;

var first = true;

var l2 = l1 + w1;

var l3 = l1 - l2;

var l = l2;

function tickinit() {

if (ie) {

if (l1 == 0 && t1 == 0) {

pos = document.all['tickpos'];

l1 = getLeft(pos);

t1 = getTop(pos);

}

ticktext.style.posTop = t1;

}

else {

if (l1 == 0 && t1 == 0) {

pos = document.anchors['tickpos'];

l1 = pos.x;

t1 = pos.y;

}

document.ticktext.pageY = t1;

}

l2 = l1 + w1;

l3 = l1 - l2;

l = l2;

setInterval('tick()', 10);

}

function getLeft(ll) {

if (ll.offsetParent)

return (ll.offsetLeft + getLeft(ll.offsetParent));

else

return (ll.offsetLeft);

}

function getTop(ll) {

if (ll.offsetParent)

return (ll.offsetTop + getTop(ll.offsetParent));

else

return (ll.offsetTop);

}

function tick() {

l = l - 0.5;

if (l < l3) l = l2;

cl = l1 - l;

cr = l2 - l;

if (ie) {

ticktext.style.posLeft = l;

ticktext.style.posTop = t1;

ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";

if (first) ticktext.style.visibility = "visible";

}

else {

document.ticktext.pageX = l;

document.ticktext.clip.left = cl;

document.ticktext.clip.right = cr;

if (first) document.ticktext.visibility = "show";

}

first = false;

}

//  End -->

</script>

 

 

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

   <a name="tickpos"> </a>

 

<div id="ticktext" style="position:absolute;font-family:arial;font-size:14pt;visibility:hidden;">

<nobr>Doesn't this message scroller look great?  You can even insert links like this: <a href="http://www.yahoo.com" target="_blank">yahoo.com</a>  Now it repeats.</nobr>

</div>

 

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

<body bgcolor="#fef4d9" OnLoad="tickinit()">

 

0 Comments

Thu

26

Feb

2009

193、消息显示器

193、消息显示器

脚本说明:

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

<script language="Javascript">

 

<!--

 

numQuotes=42;

quoteArray = new Array(numQuotes);

quoteArray[0]="\"Great spirits have always encountered violentopposition from mediocre minds.\"  -Albert Einstein";

quoteArray[0]="男孩不坏女孩不爱。真的是这样的话,那就要看男孩是坏在哪里,而女孩又是谁了。";

quoteArray[1]="不知从何时开始,到处都流传着一句爱情名言:“男孩不坏女孩不爱!”。"

quoteArray[2]="在瞧了金庸先生的封笔之作《鹿鼎记》后,笔者更是颇有些感触"

quoteArray[3]="坏男孩该是副什么模样呢?也许就如同《鹿鼎记》中的韦小宝一般吧,一个精灵跳脱的小无赖?"

quoteArray[4]="他能哄就哄,能骗就骗,侠士嘛说不上,高人嘛更是做不得。"

quoteArray[5]="但是,小无赖也罢,坏男孩也罢,这种男孩具有一种让女孩子们不能不接受的求爱精神,即“三疯精神”,叫“猎狗、疯狗、赖皮狗”,物色对象时象猎狗,求爱时像疯狗,耗上了像赖皮狗。"

quoteArray[6]="虽说这提法有些过分偏激之处,却也正点中了要害。如果真的认真按此精神去对付女孩子,恐怕无一幸免了。"

quoteArray[7]="坏男孩到底用了什么手段那么能招人爱呢?这正如雅俗之分。"

quoteArray[8]="雅,好象是高人一等的,所谓“阳春白雪”者;俗,好象是低人一等的,所谓“下里巴人”者也。"

quoteArray[9]="然而高人一等者,“国中属而和者不过数十人”;低人一等者,“国中属而和者数千人”。究竟谁高谁低,不可"

quoteArray[10]="妄评,各人喜好而已。但毕竟还是俗人多啊!"

quoteArray[11]="韦小宝就是个纯纯粹粹的俗人,俗得不能再俗了,其实也是世间每一个俗人的影子、劣根。是人都有欲,有欲则必有争,不争才是虚伪的很,那么剩下的就是用何种手段去争了。"

quoteArray[12]="小宝用的也算是一种方法啊,不论黑猫白猫,只要抓到老鼠就是好猫嘛"

quoteArray[13]="韦小宝好象还缺了点“英俊”,若是能把这点也加上了,小宝可就是“大众情人”啦!"

quoteArray[14]="话又说回来,如果让你在英俊却死板的男孩和韦小宝之间做个爱情选择,恐怕你会脱口而出:“选那个可恨又可爱的小宝”呢!"

quoteArray[15]="你瞧,他聪明伶俐,了解人情世故,又会见风使舵,讨女孩的欢心,还深谙处世之道。"

quoteArray[16]="本来么,小宝也不是什么罪大恶极的坏人。"

quoteArray[17]="他这个“坏”,坏得有学问,有原则,有所为而有所不为。"

quoteArray[18]="他可以偷抢拐骗,但那要看是对什么人"

quoteArray[19]="对吴应熊那群卖国贼、四处收刮民脂民膏的人该贪就贪,该拿就拿,何况小宝还懂得钱财乃身外之物,对于天地会和交友的费用他是豪爽大方,丝毫也不吝啬,该给就给,该送就送了。"

quoteArray[20]="小宝还很知道讲良心,讲义气,杀小人,宁死也不出卖朋友,这可是做人最基本的准则。"

quoteArray[21]="在对待康熙和陈近南两个对立面时,小宝更是大显神通可算是忠义两全之士了。"

quoteArray[22]="他和康熙可算是总角之交,其间的友谊真挚而坚定,中有地位的悬殊却是牢不可破的。"

quoteArray[23]="因此一涉及到对康熙不利的事,他是绝对不干的,还想主设法地从中作梗。"

quoteArray[24]="对陈近南他也同样够义气,陈近南和天地会是一体性的,对陈近南忠就是对天地会忠。"

quoteArray[25]="当康熙要小宝剿灭天地会时,小宝说出一番道理来:“皇上,他们要来害你,我拼命阻挡,奴才对你是讲义气的。"

quoteArray[26]="皇上要去拿他们,奴才夹在中间,难以做人,只好向你求情,那也是讲义气。"

quoteArray[27]="我拜你为师……那陈近南也是我师父,我如存心害你,那是欺师灭祖。"

quoteArray[28]="我如去害那个师父,也是欺师灭宗……。"

quoteArray[29]="这个道理十分简单,谁都想得出,可又有几人能真正做的到?"

quoteArray[30]="小宝为了这个道理不要高官,不要厚禄,甚至连性命也可以豁出去了,于是康熙虽是恼怒,却也敬重他为人有义。"

quoteArray[31]="旁观者虽瞧你行为话语不耻,却也不得不佩服。"

quoteArray[32]="于是在金庸先生笔下,只要跟小宝作对之人,均无什么好下场,都同风际中一样自取灭亡。"

quoteArray[33]="也许小宝还够不上潇洒,但他在这个世俗语社会里为人处事的游刃有余,是谁也比不上的。"

quoteArray[34]="那么,说句真心话,在这世俗社会中,若真的有一个如小宝一样既能赚钱,又会花钱"

quoteArray[35]="会玩会闹会逗你天心,骨子里也讲点良心、义气的俗人,你会不会喜欢他?爱他?"

quoteArray[36]="嘻,“男孩不坏,女孩不爱”嘛!"

quoteArray[37]="小宝为了这个道理不要高官,不要厚禄,甚至连性命也可以豁出去了,于是康熙虽是恼怒,却也敬重他为人有义"

quoteArray[38]="旁观者虽瞧你行为话语不耻,却也不得不佩服。"

quoteArray[39]="于是在金庸先生笔下,只要跟小宝作对之人,均无什么好下场,都同风际中一样自取灭亡。"

quoteArray[40]="那么,说句真心话,在这世俗社会中,若真的有一个如小宝一样既能赚钱,又会花钱"

quoteArray[41]="小宝为了这个道理不要高官,不要厚禄,甚至连性命也可以豁出去了,于是康熙虽是恼怒,却也敬重他为人有义。"

quoteArray[42]="当康熙要小宝剿灭天地会时,小宝说出一番道理来:“皇上,他们要来害你,我拼命阻挡,奴才对你是讲义气的。"

 

 

quoteShowing=-1;

 

 

 

function nextQuote()

{

  // restart at 0 if done

  if (quoteShowing >= numQuotes) quoteShowing=-1;

  quoteShowing++;

 

  // assign the value in the textbox to the new quote

  document.quoteForm.quoteHere.value = quoteArray[quoteShowing];

}

 

function prevQuote()

{

  // restart at end if on 0

  if (quoteShowing <= 0) quoteShowing=numQuotes+1;

  quoteShowing--;

 

  document.quoteForm.quoteHere.value = quoteArray[quoteShowing];

}

 

function randQuote()

{

  // Make sure you don't show the same quote 2x in a row

  prevQuoteShowing = quoteShowing;

  while(quoteShowing == prevQuoteShowing)

    quoteShowing = Math.ceil(Math.random() * numQuotes);

 

  document.quoteForm.quoteHere.value = quoteArray[quoteShowing];

}

 

//!-->

 

 

</script>

<h1>消息输出框!!</h1>

<form name="quoteForm">

  <textarea wrap="virtual" name="quoteHere" Rows=3 Cols=60>

    消息显示器

  </textarea><br>

  <input type=button value="下一条" onClick="nextQuote();">

  <input type=button value="上一条" onClick="prevQuote();">

  <input type=button value="随机" onclick="randQuote();">

</form>

 

0 Comments

Thu

26

Feb

2009

192、输入框各种效果

192、输入框各种效果

脚本说明:

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

<script language="JavaScript">

 

<!-- ActiveASCII by Neal Kanodia (please, don't delete this line)

 

function createArr(num) { for(var i = 0; i < num; i++) { this[i] = null } }

function fillArr(tx,me,ti,wa) { this.text = tx;  this.method = me.toLowerCase();  this.ticks = ti;  this.wait = wa }

function block(num,txt,mthod,tcks,wit) { blocks[num] = new fillArr(txt,mthod,tcks,wit) }

function ms(unt) { var sp = "";  for( var i = 1; i <= unt; i++ ) { sp += " " } return(sp) }

function Activate() { if (cblock == max) { cblock = 0;  if (iloop == 0) { loops--;  if (loops == 0) { meth = "0" } else { meth = blocks[cblock].method } } else { meth = blocks[cblock].method } } else { meth = blocks[cblock].method }

if (meth == "0") { document.Active.ASCII.value = end }

if (meth == "display") { Tape = blocks[cblock].text;  Wait = blocks[cblock].wait;  Display() }

if (meth == "display center") { Tape = blocks[cblock].text;  Wait = blocks[cblock].wait;  half = Tape.length / 2;  DisplayC() }

if (meth == "scroll left") { clen = tlen;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  tTicks = Ticks * 2;  ScrollL() }

if (meth == "scroll right") { clen = 0 - blocks[cblock].text.length;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  tTicks = Ticks * 2;  ScrollR() }

if (meth == "scroll lc") { clen = 0 - blocks[cblock].text.length;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  Wait = blocks[cblock].wait;  tTicks = Ticks * 2;  half = Tape.length / 2;  ScrollLC() }

if (meth == "scroll rc") { clen = tlen;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  Wait = blocks[cblock].wait;  tTicks = Ticks * 2;  half = Tape.length / 2;  ScrollRC() }

if (meth == "scroll cl") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  tTicks = Ticks * 2;  half = Tape.length / 2;  clen = cent - half;  ScrollCL() }

if (meth == "scroll cr") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  tTicks = Ticks * 2;  half = Tape.length / 2;  clen = cent - half;  ScrollCR() }

if (meth == "slide left") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  Wait = blocks[cblock].wait;  cpos = 0;  clet = Tape.charAt(cpos);  clen = tlen;  cstr = "";  SlideL() }

if (meth == "slide lc") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  Wait = blocks[cblock].wait;  cpos = Tape.length - 1;  clet = Tape.charAt(cpos);  clen = 0;  cstr = "";  half = Tape.length / 2;  iba = cent - half;  ib = ms(iba);  SlideLC() }

if (meth == "slide rc") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  Wait = blocks[cblock].wait;  cpos = 0;  clet = Tape.charAt(cpos);  cstr = "";  half = Tape.length / 2;  clen = cent + half;  fs = ms(cent - half);  SlideRC() }

if (meth == "slide cl") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  cpos = 0;  clet = Tape.charAt(cpos);  cstr = Tape.substring(1,Tape.length);  half = Tape.length / 2;  clen = cent - half;  iba = 0;  ib = ms(iba);  SlideCL() }

if (meth == "slide cr") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  cpos = Tape.length - 1;  clet = Tape.charAt(cpos);  cstr = Tape.substring(0,Tape.length - 1);  half = Tape.length / 2;  clen = 0;  fs = ms(cent - half);  SlideCR() }

if (meth == "slip left") { clen = 0;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  SlipL() }

if (meth == "slip right") { clen = 0;  Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  SlipR() }

if (meth == "slip letter") { Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  cpos = Tape.length - 1;  clet = Tape.charAt(cpos);  cstr = Tape.substring(0,Tape.length - 1);  clen = 0;  SlipLet() }

if (meth == "split"){ Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  var iii = Tape.length / 2;  if (iii / 2 != Math.ceil(iii / 2)) { Tape = Tape + " " } hstr1 = Tape.substring(0,Tape.length/2);  hstr2 = Tape.substring(Tape.length/2,Tape.length);  tTicks = Ticks * 2;  clen = cent - hstr1.length;  iba = 0;  ib = ms(iba);  Split() }

if (meth == "merge"){ Tape = blocks[cblock].text;  Ticks = blocks[cblock].ticks;  var iii = Tape.length / 2;  if (iii / 2 != Math.ceil(iii / 2)) { Tape = Tape + " " } hstr1 = Tape.substring(0,Tape.length/2);  hstr2 = Tape.substring(Tape.length/2,Tape.length);  tTicks = Ticks * 2;  clen = 0 - hstr1.length;  iba = tlen;  ib = ms(iba);  Wait = blocks[cblock].wait;  Merge() } }

function Display() { document.Active.ASCII.value = Tape;  cblock++;  timerID = setTimeout("Activate()",Wait) }

function DisplayC() { var temp = cent - half;  ini = ms(temp);  document.Active.ASCII.value = ini + Tape;  cblock++;  timerID = setTimeout("Activate()",Wait) }

function ScrollL() { if (clen >= 0) { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollL()",Ticks) } else { beg = 0 - clen;  if (beg == Tape.length) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Ticks) } else { tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollL()",tTicks) } } }

function ScrollR() { if (clen >= 0) { if (clen > tlen) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Ticks) } else { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollR()",Ticks) } } else { beg = 0 - clen;  tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollR()",tTicks) } }

function ScrollLC() { if (clen >= 0) { if (cent <= (clen + half)) { cblock++;  timerID = setTimeout("Activate()",Wait) } else { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollLC()",Ticks) } } else { beg = 0 - clen;  if (cent <= (clen + half)) { cblock++;  timerID = setTimeout("Activate()",Wait) } else { tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollLC()",tTicks) } } }

function ScrollRC() { if (clen >= 0) { if (cent >= (clen + half)) { cblock++;  timerID = setTimeout("Activate()",Wait) } else { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollRC()",Ticks) } } else { beg = 0 - clen;  if (cent >= (clen + half)) { cblock++;  timerID = setTimeout("Activate()",Wait) } tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollRC()",tTicks) } }

function ScrollCL() { if (clen >= 0) { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollCL()",Ticks) } else { beg = 0 - clen;  if (beg >= Tape.length) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Wait) } else { tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("ScrollCL()",tTicks) } } }

function ScrollCR() { if (clen >= 0) { if (clen > tlen) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Wait) } else { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollCR()",Ticks) } } else { beg = 0 - clen;  tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("ScrollCR()",tTicks) } }

function SlideL() { if (clen >= 0) { ini = ms(clen);  tickered = cstr + ini + clet;  document.Active.ASCII.value = tickered;  clen -= 3;  timerID = setTimeout("SlideL()",Ticks) } else { document.Active.ASCII.value = cstr + clet;  cstr = document.Active.ASCII.value;  clen = tlen - cstr.length;  cpos++;  clet = Tape.charAt(cpos);  if (clet == " ") { cstr = cstr + " ";  cpos++;  clet = Tape.charAt(cpos) } if (clet == "") { cblock++;  timerID = setTimeout("Activate()",Wait) } else { timerID = setTimeout("SlideL()",Ticks) } } }

function SlideLC() { if (clen <= cent - half) { ini = ms(clen);  tickered = ini + clet + ib + cstr;  document.Active.ASCII.value = tickered;  clen += 3;  iba -= 3;  ib = ms(iba);  timerID = setTimeout("SlideLC()",Ticks) } else { iba = cent - half;  ini = ms(iba);  ib = ms(iba);  document.Active.ASCII.value = ini + clet + cstr;  cstr = clet + cstr;  clen = 0;  cpos--;  if (cpos >= 0) { clet = Tape.charAt(cpos);  if (clet == " ") { cstr = " " + cstr;  cpos--;  clet = Tape.charAt(cpos) } timerID = setTimeout("SlideLC()",Ticks) } else { cblock++;  timerID = setTimeout("Activate()",Wait) } } }

function SlideRC() { if (clen >= 0) { ini = ms(clen);  tickered = fs + cstr + ini + clet;  document.Active.ASCII.value = tickered;  clen -= 3;  timerID = setTimeout("SlideRC()",Ticks) } else { clen = cent + half;  cstr += clet;  document.Active.ASCII.value = fs + cstr;  cpos++;  clet = Tape.charAt(cpos);  if (clet == " ") { cstr = cstr + " ";  cpos++;  clet = Tape.charAt(cpos) } if (clet == "") { document.Active.ASCII.value = fs + Tape;  cblock++;  timerID = setTimeout("Activate()",Wait) } else { timerID = setTimeout("SlideRC()",Ticks) } } }

function SlideCL() { if (clen > 0) { ini = ms(clen);  tickered = ini + clet + ib + cstr;  document.Active.ASCII.value = tickered;  clen -= 3;  iba += 3;  ib = ms(iba);  timerID = setTimeout("SlideCL()",Ticks) } else { iba = 0;  ib = ms(iba);  clen = cent - half;  ini = ms(clen);  document.Active.ASCII.value = ini + cstr;  cstr = cstr.substring(1,Tape.length);  cpos++;  clet = Tape.charAt(cpos);  if (clet == " ") { cstr = cstr.substring(1,Tape.length);  cpos++;  clet = Tape.charAt(cpos) } if (clet == "") { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Ticks) } else { timerID = setTimeout("SlideCL()",Ticks) } } }

function SlideCR() { if (clen <= cent + half) { ini = ms(clen);  tickered = fs + cstr + ini + clet;  document.Active.ASCII.value = tickered;  clen += 3;  timerID = setTimeout("SlideCR()",Ticks) } else { clen = 0;  document.Active.ASCII.value = fs + cstr;  cstr = cstr.substring(0,cstr.length - 1);  cpos--;  half += 1;  if (cpos >= 0) {                ;  clet = Tape.charAt(cpos);  if (clet == " ") { cstr = cstr.substring(0,cstr.length - 1);  cpos--;  clet = Tape.charAt(cpos) } timerID = setTimeout("SlideCR()",Ticks) } else { cblock++;  timerID = setTimeout("Activate()",Ticks) } } }

function SlipR() { if (clen >= 0) { if (clen > tlen) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Ticks) } else { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("SlipR()",Ticks) } } else { beg = 0 - clen;  tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen++;  timerID = setTimeout("SlipR()",Ticks) } }

function SlipL() { if (clen >= 0) { ini = ms(clen);  tickered = ini + Tape;  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("SlipL()",Ticks) } else { beg = 0 - clen;  if (beg == Tape.length) { document.Active.ASCII.value = "";  cblock++;  timerID = setTimeout("Activate()",Ticks) } else { tickered = Tape.substring(beg,tlen);  document.Active.ASCII.value = tickered;  clen--;  timerID = setTimeout("SlipL()",Ticks) } } }

function SlipLet() { if (clen < tlen) { ini = ms(clen);  tickered = cstr + ini + clet;  document.Active.ASCII.value = tickered;  clen += 3;  timerID = setTimeout("SlipLet()",Ticks) } else { clen = 0;  cstr = cstr.substring(0,cstr.length - 1);  cpos--;  if (cpos >= 0) {           ;  clet = Tape.charAt(cpos);  if (clet == " ") { cstr = cstr.substring(0,cstr.length - 1);  cpos--;  clet = Tape.charAt(cpos) } timerID = setTimeout("SlipLet()",Ticks) } else { cblock++;  timerID = setTimeout("Activate()",Ticks) } } }

function Split() { if (clen >= 0) { ini = ms(clen);  tickered = ini + hstr1 + ib + hstr2;  document.Active.ASCII.value = tickered;  clen--;  iba += 2;  ib = ms(iba);  timerID = setTimeout("Split()",Ticks) } else { if (clen <= 0 - hstr1.length) { cblock++;  timerID = setTimeout("Activate()",Ticks) } else { beg = 0 - clen;  tickered = hstr1.substring(beg,tlen);  document.Active.ASCII.value = tickered + ib + hstr2;  clen--;  iba += 2;  ib = ms(iba);  timerID = setTimeout("Split()",tTicks) } } }

function Merge() { if (clen >= 0) { if (clen > cent - hstr1.length) { tickered = ini + hstr1 + hstr2;  document.Active.ASCII.value = tickered;  cblock++;  timerID = setTimeout("Activate()",Wait) } else { ini = ms(clen);  tickered = ini + hstr1 + ib + hstr2;  document.Active.ASCII.value = tickered;  clen++;  iba -= 2;  ib = ms(iba);  timerID = setTimeout("Merge()",Ticks) } } else { beg = 0 - clen;  tickered = hstr1.substring(beg,tlen);  document.Active.ASCII.value = tickered + ib + hstr2;  clen++;  iba -= 4;  ib = ms(iba);  timerID = setTimeout("Merge()",tTicks) } }

 

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

//# User Vars

// Number of blocks (see bottom) to be displayed.

// ***COMMON ERROR***: Make sure to set this value according to the

// number of blocks (always the last block # + 1)!

var max = 18

 

// Don't change this!

var blocks = new createArr(max)

 

// Length of textbox

// ***COMMON ERROR: If you change this or the length of the

// textbox, remember to change the other accordingly.***

var len = 50

 

// Number of time to loop ALL blocks (use 0 for unlimited)

var loops = 0

 

// If you set the number of loops, set the final messege

var end = 'End of "ActiveASCII" by Neal Kanodia.'

 

// Use this format for each string (starting at 0 until 1 less

// than max):

// block(#block,"Text to display","Method",#ticks,#wait)

// example: block(0,"1st block.","Scroll Left",25,0)

// ***COMMON ERROR***: If you add a block INCREASE MAX BY 1

// ***COMMON ERROR***: If you remove a block DECREASE MAX BY 1

// ***COMMON ERROR***: Check the spelling of your methods!!!

block(17,"欢迎光临!","display",0,500)

block(18,"欢迎光临!","display center",0,500)

block(2,"欢迎光临!","scroll left",25,0)

block(3,"欢迎光临!","scroll right",25,0)

block(4,"欢迎光临!","scroll lc",25,500)

block(5,"欢迎光临!","scroll rc",25,500)

block(6,"欢迎光临!","scroll cl",25,0)

block(7,"欢迎光临!","scroll cr",25,0)

block(8,"欢迎光临!","slide left",25,500)

block(9,"欢迎光临!","slide lc",25,500)

block(10,"欢迎光临!","slide rc",25,500)

block(11,"欢迎光临!","slide cl",25,0)

block(12,"欢迎光临!","slide cr",25,0)

block(13,"欢迎光临!","slip left",25,0)

block(14,"欢迎光临!","slip right",25,0)

block(15,"欢迎光临!","slip letter",25,0)

block(16,"","display",0,500)

block(0,"欢迎!","merge",25,1000)

block(1,"欢迎!","split",25,0)

//End User Vars

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

 

// Don't change!!!

var tlen = 2.4 * len

var cent = tlen / 2.2

var clen = null

var tickered = null

var ini = null

var iloop = 0

if (loops == 0) {iloop = 1}

var cblock = 0

var timerID = null

var beg = null

var clet = null

var cstr = null

var cpos = null

var ib = null

var iba = null

var fs = null

var hstr1 = null

var hstr2 = null

<!-- end  -->

 

0 Comments

Thu

26

Feb

2009

191、文字从左到右出现

191、文字从左到右出现

脚本说明:

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

<script lanuage="JavaScript">

 

var temp

var f = "                              "

var f = f + "Put your text here."

var speedtogo = 100

 

var counter

 

 

function scrollon() {

       

   temp  = f.substring(0,1);

   f += temp

   f    = f.substring(1,f.length);

   document.wow.display.value = f.substring(0,55);

 

  counter    = setTimeout("scrollon()",speedtogo);

 

 }

 

</script>

<form name="wow">

<input type="text" size="50" name="display" value="">

</form>

 

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

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

 

0 Comments

Thu

26

Feb

2009

190、信息逐条出现

190、信息逐条出现

脚本说明:

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

<SCRIPT LANGUAGE = "JavaScript">

<!-- HTML comment to placate non JavaScript capable browsers

var timerDM=null;

var msgCnt = 6;           // 设置信息的数目.

var DisplayTime = 2000;   // 间隔时间

var msgNum = 1;

var Timeshow = DisplayTime;

function araVob() {

}

var DisplayLine = new araVob();

DisplayLine[1] = "你好";

DisplayLine[2] = "欢迎光临";

DisplayLine[3] = "谢谢";

DisplayLine[4] = "要再次来呀";

DisplayLine[5] = "祝你快乐";

DisplayLine[6] = "网页特效";

/*

 只要修改上面的[n],就可以增加信息数

*/

var msg = DisplayLine[1];

 

function DisplayMsg() {

  document.msgform.message.value=msg;

  timerDM = setTimeout("DisplayMsg()",Timeshow);

  ChangeMsg();

}

 

function ChangeMsg() {

  msgNum++;

  if (msgCnt < msgNum) {

    msgNum = 1;}

  msg = DisplayLine[msgNum];

  if (msgNum == 1) {            // change display time

    Timeshow = 3000;            // of a specific message

  }

  else {

    Timeshow = DisplayTime;

  }

}

 

function quitDisplay() {

  document.msgform.message.value="Alternate!  But don't scroll \"sideways\"!";

}

// -->

</SCRIPT>

<FORM NAME= "msgform" ACTION=" ">

  <INPUT TYPE="text"

         SIZE=32

         NAME="message"   

         VALUE="JavaScript (or JScript) Power needed.">

 </FORM>

 

 

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

189、选择显示文字方式

189、选择显示文字方式

脚本说明:

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

<SCRIPT LANGUAGE = "JavaScript">

 

<!-- HTML comment to placate non JavaScript capable browsers

 

function AraVob() {

}

var ScreenLine = new AraVob();

ScreenLine[1]  = "You can display multiple lines of text here,";

ScreenLine[2]  = "including \"blank\" lines.";

ScreenLine[3]  = " ";

ScreenLine[4]  = "Isn't this easier to read than \"sideways\" scrollers?";

ScreenLine[5]  = " ";

ScreenLine[6] = "Click on the \"Type/Scroll\" button to switch between....";

ScreenLine[7] = "  scrolling the page up with complete lines or,";

ScreenLine[8] = "  typing a line and scrolling the page up.";

ScreenLine[9] = " ";

ScreenLine[10] = "Aren't you glad your browser has JavaScript (JScript) power?";

ScreenLine[11] = "Enjoy!....";

/*

To change or add lines, just replace values of or add to ScreenLine[n]

above.   Use \" in the message text for quotes and \t for tabs.

*/

var msgNum = 1;          // set to first message to display

var msgCnt = 11;         // set to number of last ScreenLine to display.

var typeSpeed = 50;      // the typing rate in milliseconds (higher number type more slowly)

var lineDelay = 2000     // the delay time at end of line. (unless the line is a single space)

var pagLen = 6;          // number of lines per page (usually the number of rows in the TEXTAREA)  

var delay = typeSpeed;    

var timerPS = null;

var linPntr = 0;

var tally = 1;

var msg = " ";

var outMsg = "";

var i = 0;

var typingon = false;

 

// set up ScreenLines for display

for (x = msgCnt; 1 <= x; x--) {

  ScreenLine[x+pagLen] = ScreenLine[x] + "\r\n";

}

for (x = 1; x <= (pagLen); x++) {

  ScreenLine[x] =  " \r\n";

}

 msgCnt +=  pagLen;

 msg = ScreenLine[1];

// end setup

 

function SwitchIt() {

 typingon = !typingon;

}

 

function DisplayScroll() {

 if (msgNum < pagLen) {

  delay = typeSpeed;

 }

 else {

  delay = lineDelay;

 }

 ChangeMsg();

 outMsg += msg;

 self.document.msgform.msgarea.value = outMsg;

 if (typingon == true) {

  timerPS = setTimeout("DisplayMsg()",delay);

 }

 else {

  clearTimeout(timerPS);

  timerPS = setTimeout("DisplayScroll()",delay);

 }

}

function DisplayMsg() {

 if (msg.length <= i) {

  i = 0;

  ChangeMsg();

 }

 outMsg += msg.charAt(i);

 i++;

 if (msg.charAt(i) != "\n" || msg == " \r\n") {

  delay = typeSpeed;

 }

 else {

  delay = lineDelay;

 }

 self.document.msgform.msgarea.value = outMsg;

 if (typingon == false) {

  timerPS = setTimeout("DisplayScroll()",delay);

 }

 else {

  clearTimeout(timerPS);

   timerPS = setTimeout("DisplayMsg()",delay);

 }

}

 

function ChangeMsg() {

 msgNum++;

 if (msgCnt < msgNum) {

   msgNum = 1;

 }

 if (pagLen <= tally) {

   chgPage();

 }

 tally++;

 msg = ScreenLine[msgNum];

}

 

function chgPage() {

 if (msgNum < pagLen) {

   linPntr = msgCnt - pagLen + msgNum + 1;

 }

 else {

   linPntr = msgNum - (pagLen - 1);

 }

 

 outMsg =   ScreenLine[linPntr];

 for (p = 1; p < (pagLen - 1); p++) {

   linPntr++;

   if (msgCnt < linPntr) {

     linPntr = 1;

   }

   outMsg += ScreenLine[linPntr];

 }

 

}

 

function quitDisplay() {

  self.document.msgform.msgarea.value = "Type a Page for yourself today!";

}

// -->

 

</SCRIPT>

 

 

<FORM NAME = "msgform" ACTION = " ">

 <TEXTAREA NAME = "msgarea" COLS = 66 ROWS = 6>

 JavaScript (or JScript) Power needed.

 </TEXTAREA>

</FORM>

<FORM>

  <INPUT TYPE="button"

         NAME="button1"

         VALUE="逐个显示/逐行显示"

         onClick="SwitchIt()">

 </FORM>

 

 

 

 

 

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

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

 

 

0 Comments

Thu

26

Feb

2009

188、带光影的文字飞入代码

188、带光影的文字飞入代码

<script language="JavaScript">

<!--

if (document.all){

xL=5;

xH=0;

xW=0;

xR=0;

xE=0;

xMY=0;

xMX=0;

xWd=0;

xHd=0;

xF=new Array();

xY=new Array();

xX=new Array();

xS=new Array();

xA=new Array();

xB=new Array();

ini=new Array();

cl=new Array('#fff000','#0000FF','#ff0000','#00ff00','#ff00ff','#ffa500')

document.write('<div id="xouter" style="position:absolute;top:0px;left:0px"><div style="position:relative">');

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

document.write('<div id="xie" style="position:absolute;top:0;left:0;width:10px;height:10px;'

+'font-family:Courier New;font-size:50px;color:#ffffff">'+Math.round(Math.random()*9)+'</div>');

}

document.write('</div></div>');

//Initial Placement!

function Set(){

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

xH=window.document.body.offsetHeight;

xW=window.document.body.offsetWidth;

xA[i]=Math.round(Math.random()*xH);

xB[i]=Math.round(Math.random()*xW);

xS[i]=Math.random()*0.07+0.05;

xR=Math.round(Math.random()*3);

xE=Math.round(Math.random()*2500+50)

if (xR == 3) xB[i]=-xE;

if (xR == 2) xB[i]=xW+xE;

if (xR == 1) xA[i]=-xE;

if (xR == 0) xA[i]=xH;

xF[i]=xW/14;

}

}

Set();

function Assign(){

xouter.style.top=document.body.scrollTop;

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

xF[i]-=xS[i]*50;

if (xF[i] < 4) xF[i]=3;

xie[i].style.top =xY[i];

xie[i].style.left=xX[i];

xie[i].style.fontSize=xF[i];

xie[i].style.filter='glow(color='+ini[i]+', strength='+xF[i]/3+')';

}

}

function fly(){

var N=Math.floor(Math.random()*cl.length)

xMY=window.document.body.clientHeight/2;

xMX=window.document.body.clientWidth/2;

xWd=Math.round(Math.random()*40+5);

xHd=Math.round(Math.random()*30+5);

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

{

xY[i]=xA[i]+=(xMY-xA[i])*(xS[i]);             

xX[i]=xB[i]+=(xMX-xB[i])*(xS[i]); 

if ((xX[i] > xMX-xWd) && (xX[i] < xMX+xWd) && (xY[i] > xMY-xHd) && (xY[i] < xMY+xHd)){

 

 xH=window.document.body.offsetHeight;

 xW=window.document.body.offsetWidth;

 xA[i]=Math.round(Math.random()*xH);

 xB[i]=Math.round(Math.random()*xW);

 xS[i]=Math.random()*0.05+0.05;

 xR=Math.round(Math.random()*3);

 xE=Math.round(Math.random()*50+50)

 if (xR == 3) xB[i]=-xE;

 if (xR == 2) xB[i]=xW+xE;

 if (xR == 1) xA[i]=-xE;

 if (xR == 0) xA[i]=xH+xE;

}

if ((xX[i] < 0) || (xX[i] > xW) || (xY[i] < 0) || (xY[i] > xH))

 {

 xF[i]=xW/14;

 ini[i]=cl[N];

 }

}

Assign();

setTimeout('fly()',10);

}

fly();

}

// -->

</script>

 

0 Comments

Thu

26

Feb

2009

187、文字逐个出现

187、文字逐个出现

脚本说明:

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

<script lanuage="JavaScript">

 

var count = -1;

var counter;

var nchar

var speedtogo = 200

 

var a = new Array();

 

a[1] = "网页特效欢迎你的光临";

a[2] = "";

 

 

function capswitch() {

 count++

 if(count == 0){

   document.wow.display.value = a[1]

  }

 if(count == 1){

    document.wow.display.value = a[2].substring(0, 1) +

a[1].substring(20, 1)

        }

 if(count > 1){

   a[3] = a[1].substring(0, count - 1) + a[2].substring(count - 1,

count) + a[1].substring(20, count)

  document.wow.display.value = a[3]

 }

 if(count == a[1].length){

    count = -1

  }

 

         counter    = setTimeout("capswitch()",speedtogo);

 

 }

 

 

</script>

<form name="wow">

<input type="text" size="20" name="display" value="">

</form>

 

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

186、文字循环出现

186、文字循环出现

脚本说明:

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

<SCRIPT LANGUAGE="JavaScript">

 

<!-- escondamos

//texto a mostrarse

var mensaje=" >>> >>> >>> 你的 >>> 光临";

mensaje+=" >>> >>> >>> >>> ";

 

//fraccion a mostrarse

var ancho=50;

 

//rutina de mensaje deslizante

function desliza(){

document.forms[0].panel.value=mensaje.substring(mensaje.length-ancho,mensaje.length);

mensaje=mensaje.substring(mensaje.length-1,mensaje.length)+mensaje;

mensaje=mensaje.substring(0,mensaje.length-1);

setTimeout("desliza()",100);

}

 

// basta de esconder -->

 

</SCRIPT>

<form>

<INPUT TYPE="text" NAME="panel" VALUE="" SIZE="50">

</form>

 

 

 

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

<body bgcolor="#fef4d9" onLoad="desliza(); return true;">

 

0 Comments

Thu

26

Feb

2009

185、可调节速度的撞击

185、可调节速度的撞击

脚本说明:

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

<script LANGUAGE="JavaScript">

 

   var speed=500;

   var hellotext="1";

   var thetext="";

   var started=false;

   var step=0;

   var times=1;

function welcometext(){

  times--;if(times==0){

 if(started==false){started=true;

  document.forms[0].message.value=hellotext;

  setTimeout("anim()",1)}thetext=hellotext}}

function showformtext(txt){

  thetext=txt;

  setTimeout(welcometext());times++}

function anim(){step++;if(step==15){step=1}

if(step==1){document.forms[0].message.value='Ping-Pong*____________|_____________Ping-Pong'}

 

if(step==2){document.forms[0].message.value='Ping-Pong_____________|____________*Pign-Pong'}

 

if(step==3){document.forms[0].message.value='Ping-Pong____*________|_____________Ping-Pong'}

 

if(step==4){document.forms[0].message.value='Ping-Pong_____________|________*____Ping-Pong'}

 

if(step==5){document.forms[0].message.value='Ping-Pong________*____|_____________Ping-Pong'}

 

if(step==6){document.forms[0].message.value='Ping-Pong_____________|____*________Ping-Pong'}

 

if(step==7){document.forms[0].message.value='Ping-Pong____________*|_____________Ping-Pong'}

 

if(step==8){document.forms[0].message.value='Ping-Pong_____________|*____________Ping-Pong'}

 

if(step==9){document.forms[0].message.value='Ping-Pong_____________|___*_________Ping-Pong'}

 

if(step==10){document.forms[0].message.value='Ping-Pong_________*___|_____________Ping-Pong'}

 

if(step==11){document.forms[0].message.value='Ping-Pong_____________|______*______Ping-Pong'}

 

if(step==12){document.forms[0].message.value='Ping-Pong______*______|_____________Ping-Pong'}

 

if(step==13){document.forms[0].message.value='Ping-Pong_____________|__________*__Ping-Pong'}

 

if(step==14){document.forms[0].message.value='Ping-Pong__*__________|_____________Ping-Pong'}

 

if(step==15){document.forms[0].message.value='Ping-Pong_____________|_____________Ping-Pong'}

  setTimeout("anim()",speed)}

function delay(){if(speed==500){speed=10}else{speed=500}}

 

</script>

<form><INPUT Type="text" Name="message" Size="44"><p>

<INPUT Type="button" Value="快速/减速" onClick="delay()"></form>

 

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

184、一段彩色的文字

184、一段彩色的文字

脚本说明:

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

<SCRIPT language="JavaScript">

 

var browser = "unknown";

var version = 0;

 

if (navigator.userAgent.indexOf("Opera") >= 0)

 browser = "opera";

else if (navigator.userAgent.indexOf("obot") >= 0)

 browser = "robot";

else if (navigator.appName.indexOf("etscape") >= 0)

 browser = "netscape";

else if (navigator.appName.indexOf("icrosoft") >= 0)

 browser = "msie";

 

version = parseFloat(navigator.appVersion);

if (isNaN(version)) version = 0;

if ((browser == "msie")&&(version == 2)) version = 3;

 

 

 

// lookup table

var tohex = new Array(256);

var hex = "0123456789ABCDEF";

var count = 0;

for (x=0; x<16; x++) {

 for (y=0; y<16; y++) {

 tohex[count] = hex.charAt(x) + hex.charAt(y);

 count++;

 }

}

 

//ColorCode constructor

function ColorCode(hexcode) {

  if (hexcode.length == 7) {

    this.r = parseInt(hexcode.substring(1,3),16);

    this.g = parseInt(hexcode.substring(3,5),16);

    this.b = parseInt(hexcode.substring(5,7),16);

  }

  else if (hexcode.length == 6) {

    this.r = parseInt(hexcode.substring(0,2),16);

    this.g = parseInt(hexcode.substring(2,4),16);

    this.b = parseInt(hexcode.substring(4,6),16);

  }

  else {

    this.r = this.g = this.b = 0;

    alert("Error: ColorCode constructor failed");

  }

  if (isNaN(this.r)||isNaN(this.g)||isNaN(this.b))

    alert("Error: ColorCode constructor failed");

}

 

// ColorList constructor

function ColorList(hexcodes) {

  var i = 0;

  var c = 0;

  this.codes = new Array(Math.round(hexcodes.length/7));

  while (i < hexcodes.length) {

    if (isNaN(parseInt(hexcodes.substring(i,i+6),16))) ++i;

    else {

      this.codes[c] = new ColorCode(hexcodes.substring(i,i+6));

      i += 7;

      ++c;

    }

  }

  this.len = c;

}

 

function interpolate (x1, y1, x3, y3, x2) {

  if (x3 == x1) return y1

  else return (x2-x1)*(y3-y1)/(x3-x1) + y1

}

 

// x=index of letter, y=number of letters, z=number of colors

function lowcolorindex (x, y, z) {

  if (y == 1) return 0

  else return Math.floor( (x*(z-1))/(y-1) )

}

 

function hicolorindex (x, y, z, low) {

  if ( low*(y-1) == x*(z-1) ) return low

  else if (y == 1) return 0

  else return Math.floor( (x*(z-1))/(y-1) + 1 )

}

 

function gradient (thetext,thecolors) {

  if (((browser == "netscape")||(browser == "msie")||(browser == "opera"))&&(version>=3.0)) {

    var colors = new ColorList(thecolors);

    var numcolors = colors.len;

    var numchars = thetext.length;

    var rr = 0;

    var gg = 0;

    var bb = 0;

    var lci = 0; //lower color index

    var hci = 0; //high color index

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

      lci = lowcolorindex(i, numchars, numcolors);

      hci = hicolorindex(i, numchars, numcolors, lci);

      rr = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].r, hci/(numcolors-1), colors.codes[hci].r, i/(numchars-1)));

      gg = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].g, hci/(numcolors-1), colors.codes[hci].g, i/(numchars-1)));

      bb = Math.round(interpolate( lci/(numcolors-1), colors.codes[lci].b, hci/(numcolors-1), colors.codes[hci].b, i/(numchars-1)));

      if (browser == "opera") {

        rr = 255 - rr;

        gg = 255 - gg;

        bb = 255 - bb;

      }

        document.write(thetext.charAt(i).fontcolor(tohex[rr]+tohex[gg]+tohex[bb]));

    }

  }

  else document.write(thetext); // unrecognized browser, better not to attempt anything fancy

}

     

 

</SCRIPT>

<SCRIPT language="JavaScript">

gradient("always wanted to be a genius?","FF0000 FFFFFF 0000FF");

document.write('<BR>');

gradient("...well...do it, in...","444444 DDDDDD 444444");

document.write('<BR><FONT size=+1><TT><B>');

gradient("snazzy, eyecatching, gradient colors!","FF8888 FFFF88 88FF88 88FFFF 8888FF FF88FF");

document.write('</B></TT></FONT><BR><FONT size=2>');

gradient("but uhm, just be careful not to overdo it","884488 444488 448888 448844 888844 884444");

document.write("</FONT><BR>");

</SCRIPT>

 

0 Comments

Thu

26

Feb

2009

183、可调节的输出形式

183、可调节的输出形式

脚本说明:

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

 <SCRIPT>

 

 var msg = "javascript欢迎你的光临!!!"

 

 var x = ""

 

 num = 1

 

 toggle = 1

 

 tt = 1

 

 OOK = 0

 

 timval = 60

 

 var tval = ""

 

 function switcha() {

 

    if (document.myform.dowhat.value == "Start/Stop" )

 

      tval = "Forward/Backward"

 

    if (document.myform.dowhat.value == "Forward/Backward")

 

      tval = "Fast/Slow"

 

    if (document.myform.dowhat.value == "Fast/Slow")

 

      tval = "Start/Stop"

 

    document.myform.dowhat.value = tval

 

 }

 

 function switcha2() {

 

    if (document.myform.dowhat.value == "Start/Stop" ) toggla()

 

    if (document.myform.dowhat.value == "Forward/Backward" ) csd()

 

    if (document.myform.dowhat.value == "Fast/Slow" ) fasl()

 

 }

 

 function fasl() { timval = (timval==60 ? 150 : 60 ) }

 

 

 

 function csd() {

 

    tt = ( tt==1 ? 0 : 1)

 

 }

 

 function scroll() {

 

   if (tt==1)

 

     if (num <= msg.length)

 

       OOK = 1

 

   if (tt==0)

 

     if (num >= 0)

 

       OOK = 1

 

 

 

   if ( OOK == 1)

 

  {

 

  OOK = 0

 

  x = msg.substring(0,num)

 

  document.myform.scroll.value = x

 

  num = ( tt==1 ? num+1 : num-1 )

 

  }

 

   else

 

  {

 

  x = ""

 

  document.myform.scroll.value = ""

 

  num = (tt==1 ? 0 : msg.length )

 

  }

 

   if (toggle == 1)

 

  setTimeout("scroll()", timval)

 

 }

 

 function toggla() {

 

  toggle = (toggle == 1 ? 0 : 1 )

 

  if (toggle == 1) scroll()

 

 }

 

 

 

 </SCRIPT>

 <FORM NAME="myform">

 <INPUT TYPE="text" NAME="scroll" SIZE=&{msg.length + 2}; ><br>

 <INPUT TYPE="button"  VALUE="Do It" onClick="switcha2()">

 <INPUT TYPE="text" NAME="dowhat" SIZE = 10 VALUE = "Start/Stop">

 <INPUT TYPE="button" VALUE="next" onClick="switcha()" >

 </FORM>

 

 

 

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

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

 

0 Comments

Thu

26

Feb

2009

182、调节文字移动形式

182、调节文字移动形式

脚本说明:

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

<script language="JavaScript">

 

var u=0

var v=0

var f = Math.PI/180

var txt="----------------------------------------------------------------------------------------------------"

u=0

var text1 = "=> 欢迎你 <=---"

var text2 = "=> javascript <=---"

var text = text1

var cpt=19

var t=0

var z=0

function maketab(pas) {

        for (var i=0; i<180; i++) {

        sinus = Math.round(Math.sin(i*f)*100);

        this[i] = sinus;

        }      

}

        var tb = new maketab()

 

function change() {

        cpt++

        if (cpt==20) {

                if (t==0) {

                        text = text1

                        t=1;

                }

                else {

                        text = text2

                        t=0;

                }

                cpt=0;

        }

}

 

function move(z) {

 

        if (u>180) {u=0}

        if (v>180) {v=0}

        change()

        if (z==0) {

                u+=2

                document.forms[0].elements[0].value = txt.substring(0,tb[u]) + text

        }

        if (z==1) {

                v+=2

                window.status = txt.substring(0,tb[v]) + text

        }

        if (z==2) {

                u+=2

                v+=2

                document.forms[0].elements[0].value = txt.substring(0,tb[u]) + text

                window.status = txt.substring(0,tb[v]) + text

        }

 

        setTimeout ("move(z)",150);  //设置字符移动速度

}

 

</script>

<form name="msg">

  <p><input type="text" size="79" name="mesg"> </p>

  </small></font></small></p>

 

  <p><input type="text" size="37" name="message" value="在这里输入">

  </small></font></small>

  <input type="text" size="37" name="message2" value="也可在这里输入">

  </small></font></small><br>

  <input type="button" name="newmsg" value="自己创建文字" onclick="text1=form.message.value; text2=form.message2.value;">

  </small></font></small></p>

 

  <p><input type="button" size="79" name="winstatus" value="状态栏显示" onclick="z=1">

  </small></font></small>

  <input type="button" size="79" name="txtarea" value="文本框显示" onclick="z=0">

  </small></font></small>

  </small></font></small>

  <input type="button" size="79" name="both" value="状态栏和文本框都显示" onclick="z=2">

  </small></font></small></p>

</form>

 

 

 

 

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

<body bgcolor="#fef4d9" onload=move(0)>

 

0 Comments

Thu

26

Feb

2009

181、文字飘动输出

181、文字飘动输出

脚本说明:

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

 

   <SCRIPT LANGUAGE=JAVASCRIPT>

 

 var ltext="超级www.7stk.com欢迎你的光临!!!" /*the message*/

 

 var spc=10 /*spacing*/

 

 var speed=50 /*speed in milliseconds*/

 

 var times=2 /*number of times to run each style*/

 

 

 

 /* DISPLAY DIMENTIONS */

 

 var rows=5 /*number of textarea rows*/

 

 var cols=60 /*number of textarea coloums*/

 

 

 

 /* ADVANCED OPTIONS */

 

 var addstopbutton=true /*add optional stop button? ture=yes false=no*/

 

 var stopbuttonvalue="                 STOP                     " /* Text For Stop Button */

 

 var startvalue="                 START                     " /* When Stop Button Clicked Button Value=? */

 

 

 

 /* END OF OPTIONS */

 

 

 

 var len=spc*2;var text=ltext;var i;

 

 var stop=false;var stopped;

 

 for (i=0;i<spc;i++){text=text+" "}

 

 function array(n) {

 

 this.length = n

 

 for (i=1; i <= n; i++){this[i] ="";}

 

 return this}

 

 

 

 document.writeln('<FORM NAME="F">')

 

 document.writeln('<TEXTAREA ROWS='+rows+' COLS='+cols+' NAME="D" WRAP=SOFT<>/TEXTAREA>')

 

 if (addstopbutton){document.writeln('<BR><INPUT TYPE=BUTTON VALUE="'+stopbuttonvalue+'" ONCLICK="stopstart()" NAME=SS>')}

 

 document.writeln('</FORM>')

 

 

 

 var l=text.length

 

 var ll=ltext.length;

 

 var lb=new array(l)

 

 var lr=new array(spc*2+1)

 

 var lg=new array(ll)

 

 var lk=new array(ll)

 

 lb[0]=text;

 

 lb[l]=text;

 

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

 

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

 

                 lb[j]=lb[j]+lb[j-1].charAt(i);if(i==l){lb[j]=lb[j]+lb[j-1].charAt(0)

 

                 }

 

         }}

 

 

 

 lr[0]=ltext;

 

 lr[spc*2]=ltext;

 

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

 

         lr[i]=" "+lr[i-1]

 

         }

 

 for (i=spc*2-1;i>=spc+1;i--){

 

         lr[i]=" "+lr[i+1]

 

         }

 

 

 

 lg[0]=ltext;

 

 var ll=ltext.length;

 

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

 

         for (i=lg[j-1].length-2;i>=0;i--){

 

                 lg[j]=lg[j-1].charAt(i)+lg[j];

 

                 }}

 

 lk[ll]=ltext;

 

 for (j=ll-1;j>=0;j--){

 

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

 

                 lk[j]=lk[j]+lk[j+1].charAt(i);

 

                 }}

 

 

 

 var lge="";var lbe="";var rle="";

 

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

 

 lge=lge+lg[i]+unescape('%0D%0A')}

 

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

 

 lbe=lbe+lb[l-i]+unescape('%0D%0A')}

 

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

 

 rle=rle+lr[spc*2-i]+unescape('%0D%0A')}

 

 

 

 var c=1;

 

 var i=ll;

 

 var j=0;

 

 var f=0;

 

 

 

 

 

 function lgf(){

 

 if(stop==false){

 

 if(i>ll){j=0;i=i-2};

 

 if(i==0&&j==0){c++;j=1};

 

 if(j!=0){document.F.D.value=lg[i]+unescape('%0D%0A')+document.F.D.value;i++}

 

 if(j==0){document.F.D.value=lg[i]+unescape('%0D%0A')+document.F.D.value;i--}

 

 if(c<=times){setTimeout("lgf()",speed)}else{document.F.D.value=lge;i=0;j=0;c=0;t()}

 

 }

 

 }

 

 

 

 

 

 function t(){

 

 if(stop==false){

 

 if(i>l){i=1};

 

 document.F.D.value=lb[i]+unescape('%0D%0A')+document.F.D.value;i++;j++

 

 if(j<=l*times){setTimeout("t()",speed)}else{document.F.D.value=lbe;i=0;j=0;rl()}

 

 }

 

 }

 

 

 

 function rl(){

 

 if (stop==false){

 

 if(i>=spc*2){i=0};

 

 document.F.D.value=lr[i]+unescape('%0D%0A')+document.F.D.value;

 

 i++;j++;

 

 if(j<len*times){setTimeout("rl()",speed)}else{document.F.D.value=rle;i=ll-1;j=0;trans()}

 

 }}

 

 

 

 function trans(){

 

 if(stop==false){

 

 document.F.D.value=lk[i]+unescape('%0D%0A')+document.F.D.value;i--;

 

 if(i!=1){setTimeout("trans()",speed)}else{i=ll;lgf()}

 

 }}

 

 

 

 function stopstart(){

 

 stopped=stop;

 

 if(stopped==false){stop=true;document.F.SS.value=startvalue}

 

 if(stopped==true){stop=false;document.F.SS.value=stopbuttonvalue;document.F.D.value="";i=11;j=0;c=0;lgf()}

 

 }

 

 

 

 

 

 if (rows>spc||rows>ll){alert("ERROR!\nrows can NOT be more that spaces or message length!!!!\ndont ask why thats just the way it is.")}

 

 if (spc+ll>cols){alert("ERROR!\ncols(coloums) can NOT be less that the message length + spacing length")}

 

 if (rows<=spc&&rows<=ll&&spc+ll<=cols){lgf()}

 

 

 

 </SCRIPT>

 

0 Comments