home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2002 October
/
PCWorld_2002-10_cd.bin
/
Software
/
Komercni
/
complet
/
textzoomfader.js
< prev
next >
Wrap
Text File
|
2002-03-29
|
2KB
|
75 lines
// CREDITS:
// Flashlike zoom-fade-scroller
// by Urs Dudli and Peter Gehrig
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com/fast/index.html
// info@24fun.com
// 11/21/2000
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a link to http://www.24fun.com/fast/index.html on the webpage
// where this script will be running.
// CONFIGURATION:
// Go to http://www.24fun.com/fast/index.html and download the script as ZIP-file
// with step-by-step instructions and copy-and-paste installation.
var timer
var marginright=10
var i_fadestrength=20
var i_message=0
var i_messagecolor=0
var i_messagefont=0
var step=20
var maxfontsize=100
var fontsizefactor=maxfontsize/80
var content
var textboxwidth=0
var bodywidth=0
message=message.split(" ")
function setmessage() {
if (i_message>=message.length) {i_message=0}
if (i_messagecolor>=messagecolor.length) {i_messagecolor=0}
if (i_messagefont>=messagefont.length) {i_messagefont=0}
content="<nobr><font color="+messagecolor[i_messagecolor]+" face="+messagefont[i_messagefont]+">"+message[i_message]+"</font><nobr>"
textbox.innerHTML=content
i_message++
i_messagecolor++
i_messagefont++
timer=setTimeout("resizemessage()",500)
}
function resizemessage() {
if (i_fadestrength<120) {
textbox.filters.alpha.opacity=Math.floor(100-i_fadestrength)
document.all.textbox.style.fontSize=i_fadestrength*fontsizefactor
document.all.textbox.style.posLeft=positionleft-(Math.floor(i_fadestrength/1.1*fontsizefactor))
document.all.textbox.style.posTop=positiontop
document.all.textbox.style.width=bodywidth-document.all.textbox.style.posLeft-5
document.all.textbox.style.overflowX="hidden"
document.all.textbox.style.visibility="visible"
step+=1.5
i_fadestrength+=step
timer=setTimeout("resizemessage()",100)
}
else {
clearTimeout(timer)
i_fadestrength=0;
step=1;
setmessage()
}
}
if (document.all) {
document.write("<DIV id='textbox' style='position:absolute;font-family:Arial CE,Helvetica CE,Arial,Helvetica,sans-serif,Verdana;font-weight:bold;filter:alpha(opacity=0);'></DIV>")
document.write("<DIV style='position:relative;'>")
}
if (document.all) {
bodywidth=document.body.clientWidth-5
setmessage()
}