BluePink BluePink
XHost
Gazduire site-uri web nelimitata ca spatiu si trafic lunar la doar 15 eur / an. Inregistrare domenii .ro .com .net .org .info .biz .com.ro .org.ro la preturi preferentiale. Pentru oferta detaliata accesati site-ul BluePink
enter page web design web resource entertainment personals  

Tricks: How to...
Image effects:
Preload images
Preload images 2
Swap images
Swap images 2
View larger image
Image transparency
Image slideshow
Special effects:
Border
Border 2
Watermark
Scroller
Scroller 2
Link hover color
Custom cursor
Snowing
Auto window resizer
Link tips
Popup
Buttons & menus:
Back button
Java buttons
Flat buttons
Slide menu
Drop down menu
Alphabet menu
Mouse effects:
Elastic mouse
Mouse snake
Mouse stars
Mouse orbit
Mouse eyes
Text generators:
Infobox
Quote generator
Fading messages
Text fader
Text glow
Credits

home > real world > web resource > web source codes >

This DHTML script will cycle through several different text links.

Starting Messages...

STEP 1/2: Copy this code into the <HEAD> of your HTML document:

<HEAD>
<style>
<!--
#msgline {
position:relative;
width:400;
height:20;
}
#msgtext {
position:absolute;
border: 1px solid #009900;
padding:3px;
width:400;
height:20;
}
.msgtextfont {
font:bold 12px Trebuchet MS;
position:absolute;
left:5px;
}
.msgtextfont a {color:#9999ff;}
-->
</style>
</HEAD>

STEP 2/2: Put this code in the <BODY> of your document:

<BODY onload="if (document.all||document.layers) {regenerate2();update()}">

<div id="msgline">
<div id="msgtext" class="msgtextfont">Starting Messages...</div>
</div>

<script language="JavaScript1.2">
var speed=3000
var news=new Array()
news[0]="<a href='link1'>First line of text...</a>"
news[1]="<a href='link2'>Second line of text...</a>"
news[2]="<a href='link3'>Third line of text...</a>"
news[3]="<a href='link4'>Add as many as you want...</a>"
i=0
if (document.all)
tickerobject=document.all.msgtext.style
else
tickerobject=document.msgline.document

function regenerate(){
window.location.reload()
}

function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",450)
}

function update(){
BgFade(0xff,0xff,0xff, 0x22,0x66,0x22,15);
if (document.layers){
document.msgline.document.msgtext.document.write('<span class="msgtextfont">'+news[i]+'</span>')
document.msgline.document.msgtext.document.close()
}
else
document.all.msgtext.innerHTML=news[i]
if (i<news.length-1)
i++
else
i=0
setTimeout("update()",speed)
}

function BgFade(red1, grn1, blu1, red2,
grn2, blu2, steps) {
sred = red1; sgrn = grn1; sblu = blu1;
ered = red2; egrn = grn2; eblu = blu2;
inc = steps;
step = 0;
MsgDither();
}

function MsgDither() {
var epct = step/inc;
var spct = 1 - epct;
if (document.layers)
tickerobject.bgColor =
Math.floor(sred * spct + ered *
epct)*256*256 +
Math.floor(sgrn * spct + egrn * epct)*256 +
Math.floor(sblu * spct + eblu * epct);
else
tickerobject.backgroundColor=
Math.floor(sred * spct + ered *
epct)*256*256 +
Math.floor(sgrn * spct + egrn * epct)*256 +
Math.floor(sblu * spct + eblu * epct);
if ( step < inc ) {
setTimeout('MsgDither()',50);
}
step++;
}

</script>

</BODY>
© copyright 2004 - DigitalElf.ro - marian_dumitriu@yahoo.com