Vertikální scrolující text -
zdrojový kód
<html>
<head>
<title>Java Script ze stránky - www.jaknaweb.com</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
</head>
<SCRIPT language=JavaScript>
if (document.layers) {
alert("This script does not work with Netscape Navigator")
}
var message = new Array()
message[0]="www.jaknaweb.com"
message[1]="vše pro web"
message[2]="PHP"
message[3]="scripty"
message[4]="diskuse"
message[5]="HTML"
message[6]="css"
message[7]="jak na web... "
for (i=0;i<message.length-1;i++) {
message[i]=message[i]+" "
}
var i_message=0
var i_meslength=0
var scrollerheight=270
var scrollerwidth=400
var startheight=0
var font_size=18
var font_family="Arial"
function initiate() {
if (document.all) {
document.all.rotationstyle.style.posLeft=-(Math.floor(scrollerwidth/2))+font_size
document.all.rotationstyle.style.posTop=startheight
document.all.backcolor.style.posLeft=0
document.all.backcolor.style.posTop=0
startscroll()
}
}
function startscroll() {
if (i_meslength<=message[i_message].length) {
do_rotate="yes"
rotationstyle.innerHTML=
'<OBJECT ID="rotationobj" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(10)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(255,255,255)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,255)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 0, 1, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[i_message].substring(0,i_meslength)+'\', 0, 0, 0)">'+
'</OBJECT>'
rotationobj.Rotate(0,0,-90)
i_meslength+=4
timer=setTimeout("startscroll()",50)
}
else {
timer=setTimeout("changemessage()",4000)
}
}
function changemessage() {
i_message++
if (i_message>=message.length) {i_message=0}
i_meslength=0
startscroll()
}
// - End of JavaScript - -->
</SCRIPT>
<BODY style="OVERFLOW-Y: hidden; OVERFLOW-X: hidden; WIDTH: 100%" onload=initiate()>
<DIV id=backcolor
style="LEFT: -2000px; WIDTH: 30px; POSITION: absolute; HEIGHT: 300px; BACKGROUND-COLOR: red"></DIV>
<DIV id=rotationstyle style="LEFT: -2000px; POSITION: absolute">
<OBJECT id=rotationobj
classid=CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6></OBJECT></DIV>
<DIV id=delethethistext style="LEFT: 80px; POSITION: absolute; TOP: 20px">
</DIV>
</Body>
</HTML>