上一页       3     4     5     6            下一页

 

文字特效代码8

 

Thu

26

Feb

2009

215、数字选中放大

215、数字选中放大

<html>

 

<head>

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

<title>太酷了!模仿3D的消息</title>

 

 

 

 

 <style type="text/css">

 

  ul#hovershow2{

   list-style-type: none;

   margin: 50px;

   width:200px;

   float: left;

   display: inline;

   clear: both;

  }

  ul#hovershow2 li{

   float: left;

   display: inline;

   width:20px;

   height: 20px;

   margin: 2px;

    

  }

  ul#hovershow2 li a {

   text-decoration: none;

   display: block;

   width:20px;

   height:20px;

   border:1px red solid;

   background-color: White;

   line-height: 20px;

   font-size: 12px;

   text-align: center;

  }

 

  ul#hovershow2 li a:hover{

  position: absolute;

  width:40px;

  height: 40px;

  line-height: 40px;

  font-size: 32px;

  z-index:100;

  margin: -10px 0 0 -10px;

  }

ul#hovershow2 li:hover + li a{

  position: absolute;

  width:30px;

  height: 30px;

  line-height: 30px;

  font-size: 24px;

  z-index:99;

  margin: -5px 0 0 -5px;

  }

 

 </style>

</head>

 

<body>

 

 

 

 

<ul id="hovershow2">

 <li><a href="#1" title="test"><span>1</span></a></li>

 <li><a href="#1" title="test"><span>2</span></a></li>

 <li><a href="#1" title="test"><span>3</span></a></li>

 <li><a href="#1" title="test"><span>4</span></a></li>

 <li><a href="#1" title="test"><span>5</span></a></li>

 <li><a href="#1" title="test"><span>6</span></a></li>

 <li><a href="#1" title="test"><span>7</span></a></li>

</ul>

 

</body>

 

</html>

 

0 Comments

Thu

26

Feb

2009

214、淡入淡出的文本效果

214、淡入淡出的文本效果

<SCRIPT>

 

// set your messages. Add as many as you like (you may add additional HTML-tags)

var text=new Array()

text[0]="欢迎光临网页特效集锦CODE.XINNEW.COM"

text[1]="这里有您需要的特效代码."

text[2]="让您的网站更精彩"

 

// set the corresponding links

// If you don't want to link a message just add a "#" instead of an URL

var textlink=new Array()

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

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

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

 

// set the corresponding targets

// Acceptable values are "_blank", "_self", "_top" or the name of any frame

var texttarget=new Array()

texttarget[0]="_blank"

texttarget[1]="_self"

texttarget[2]="_top"

 

// set the font of the messages

var textfont="Arial"

 

// set the font-color of the messages

var textfontcolor="#FFFFFF"

 

// set the rollover-fontcolor of the messages

var textfontcolorrollover="#FF0000"

 

// set the font-size of the messages (CSS-values)

var textfontsize=9

 

// set the font-size for Netscape 4x (HTML-values)

var textfontsizeHTML=2

 

// set the font backgroundcolor of the textbox

var textbgcolor="#000000"

 

// set the textweight (normal or bold)

var textweight="nomal"

 

// set the fontstyle (normal or italic)

var textitalic="normal"

 

// set the width of the textbox (pixels)

var textwidth=240

 

// set the height of the textbox (pixels)

var textheight=60

 

// set the pause (seconds)

var textpause=2

 

// set the width of the border

var textborder=2

 

// set the color of the border

var textbordercolor="#FF0000"

 

// set the horizontal alignment of the messages (center, left, right)

var textalign="center"

 

// set the vertival alignment of the messages (middle, top, bottom)

var textvalign="middle"

 

// do not edit below this line

var textdecoration="none"

var textweightA="<b>"

var textweightB="</b>"

var textitalicA=""

var textitalicB=""

var transparency=100

var transparencystep=2

 

var x_pos=0

var y_pos=0

var i_text=0

var textsplit=""

var i_textsplit=0

var i_mark=0

var tickercontent

var pausefade=30

textpause*=1000

 

var oneloopfinished=false

 

var browserinfos=navigator.userAgent

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

var ns4=document.layers

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

var opera=browserinfos.match(/Opera/) 

var browserok=ie||ns4||ns6||opera

 

function changecontent() {

       getcontent()

       i_text++

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

       if (ie) {

              ticker.innerHTML=content

              fadeout()

       }

       if (opera || ns6) {

              document.getElementById('ticker').innerHTML=content

              var texttimer=setTimeout("changecontent()",2*textpause)

       }

       if (ns4) {

              document.roof.document.ticker.document.write(content)

              document.roof.document.ticker.document.close()

              var texttimer=setTimeout("changecontent()",textpause)

       }    

}

 

function fadein() {

       if (transparency<100){

              transparency+=transparencystep

              if (ie) {

                     document.all.tickerbg.filters.alpha.opacity=transparency

              }

              var fadetimer=setTimeout("fadein()",pausefade)

       }

       else {

              clearTimeout(fadetimer)

              setTimeout("changecontent()",1000)

       }

}

 

function fadeout() {

       if (transparency>0){

              transparency-=transparencystep

              if (ie) {

                     document.all.tickerbg.filters.alpha.opacity=transparency

              }

              if (ns6) {

                     document.getElementById('tickerbg').style.MozOpacity=transparency/100

              }

              var fadetimer=setTimeout("fadeout()",pausefade)

       }

       else {

              clearTimeout(fadetimer)

              setTimeout("fadein()",textpause)

       }

}

 

getcontent()

function getcontent() {

       if (ie || opera) {

              var tablewidth=textwidth-2*textborder

              var tableheight=textheight-2*textborder

       }

       else {

              var tablewidth=textwidth

              var tableheight=textheight

       }

       if (ie || ns6) { 

              var padding=parseInt(textborder)+3

              content="<table width="+tablewidth+" height="+tableheight+" cellpadding="+padding+" cellspacing=0 border=0><tr valign="+textvalign+"><td align="+textalign+">"

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

              content+=text[i_text]

              content+="</a></td></tr></table>"

       }

       else {     

              content="<table width="+tablewidth+" height="+tableheight+" cellpadding="+textborder+" cellspacing=0><tr valign="+textvalign+"><td align="+textalign+">"

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

              content+=text[i_text]

              content+="</a></td></tr></table>"

 

              framecontent="<table width="+tablewidth+" height="+tableheight+" cellpadding=0 cellspacing=0 border="+textborder+"><tr><td>"

              framecontent+="<font color=\""+textbgcolor+"\">"

              framecontent+="."

              framecontent+="</font>"

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

       }

}

 

if (ie || ns6 || opera) {

       if (ns6) {

              textwidth-=2*textborder

              textheight-=2*textborder

       }

       document.write("<div id=\"roof\" style=\"position:relative;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;background-color:"+textbgcolor+";\">")

 

      

       if (!opera && !ns6 ) {

              document.write("<div id=\"tickerbg\" style=\"position:absolute;top:"+-textborder+"px;left:"+-textborder+"px;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+";border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;background-color:"+textfontcolor+";overflow:hidden\;filter:alpha(opacity=100)\">")

              document.write("</div>")

       }

      

       document.write("<div id=\"ticker\" style=\"position:absolute;top:"+-textborder+"px;left:"+-textborder+"px;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+";border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;overflow:hidden\;\">")

       document.write("</div></div>")

 

       window.onload=changecontent

}

 

else if (ns4) {

       document.write("<ilayer name=\"roof\" width="+textwidth+" height="+textheight+">")

              document.write("<layer name=\"tickerframe\" width="+textwidth+" height="+textheight+" top=0 left=0 bgcolor="+textbgcolor+">")

              document.write(framecontent)

              document.write("</layer>")

              document.write("<layer name=\"ticker\" width="+textwidth+" height="+textheight+" top=0 left=0>")

              document.write()

              document.write("</layer>")

       document.write("</ilayer>")

       window.onload=changecontent

}

</script>

 

0 Comments

Thu

26

Feb

2009

213、不断变色的文字

213、不断变色的文字

<style type="text/css">

<!--

#c {font-size: 36px;}

-->

</style>

<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

212、一霓虹灯广告字

212、一霓虹灯广告字

<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

211、页面中上小弹跳的文字

211、页面中上小弹跳的文字

<script language="JavaScript">

<!--

done = 0;

step = 4

function anim(yp,yk)

{

 if(document.layers) document.layers["napis"].top=yp;

 else  document.all["napis"].style.top=yp;

 

 if(yp>yk) step = -4

 if(yp<60) step = 4

 

 setTimeout('anim('+(yp+step)+','+yk+')', 10);

}

 

 

function start()

{

 if(done) return

 done = 1;

 

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

  document.napis.left=innerWidth/2 - 145;

  anim(60,innerHeight - 60)

 }

 else {

  napis.style.left=280;

  anim(60,document.body.offsetHeight - 60)

 }

 

}

 

//-->

</script>

                  <div id="napis"

style="position: absolute; top: 159px; width: 400px; height: 78px; left: 215px"><font size="5"><b>上下不停弹跳的文本</b></font></div>

                  <script language="JavaScript">

<!--

 setTimeout('start()',10);

//-->

</script>

 

0 Comments