AHD | Дата: Пятница, 21.08.2009, 13:20:49 | Сообщение # 1 |
сержант
Группа: Hовички
Сообщений: 100
Замечания:[0]
Добавить замечание
Репутация: 0
Наказания: 0%
Статус: Offline
| Code <html>
<head> <meta content="text/html; charset=windows-1251" http-equiv="Content-Type"> <script> <!-- Beginning of JavaScript -
// CREDITS: // First newsticker worming its way through your webpage by Urs Dudli and Peter Gehrig // Copyright (c) 1999 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.ch. // info@24fun.ch // 1/6/2000
// IMPORTANT: // If you add this script to a script-library or script-archive // you have to add a link to http://www.24fun.ch on the webpage // where this script will be running.
// INSTRUCTIONS: // Configure the script as follows:
// Configure the content of our messages. Important: the space at the end of the sentence!!! // You may use as many messages as you like. // ATTENTION: use only as many letters per message as configured // below the message block (see variable maxtextlength))
var mes = new Array() mes[0]="JavaScript " mes[1]="http://krigler.narod.ru " mes[2]="Все для WEB дизайна " mes[3]="Заходи на krigler.narod.ru "
// The maximal number of letters of each message. The bigger this number the slower the newsworm ... var maxtextlength=30
// The path of the newsworm. How can you configure this path? Best way: // 1. Produce an empty (white) gif-image with your graphic-tool, size about 800x600 pixels. // 2. Open the application that you are using to create imagemaps (for instance CuteMAP). // 3. Open this gif-image. // 4. Set the drawing-tool to "polygon". // 5. Draw a path. // 6. Copy and paste the resulting values inside the path-array below. // ATTENTION: There should be no space between the numbers!!! var path= new Array(548,316,581,296,598,257,577,215,559,202,503,193,464,203,446,222,448,255,468,274,500,280,526,267,541,237,537,209,526,187,499,161,462,14 6,412,133,368,129,326,132,293,142,272,159,250,184,239,204,234,213,226,230,201,253,186,259,165,265,136,268,110,270,83,267,58,260,36,243,26,22 9,22,210,24,191,29,174,39,163,56,154,76,150,96,149,110,148,135,152,165,156,196,165,208,172,231,181,254,192,280,203,305,210,339,210,366,206,3 89,195,405,182,419,167,428,148,442,116,448,80,443,41,401,8,347,0,300,11,280,30,256,50,230,58,198,61,169,56,141,50,113,45,87,36,70,29,52,24,2 8,18,7,15)
// How many seconds shall the textsnake remain quiet after moving? var stoptime=2
// Choose fontfamily, fontsize and fontcolor. var textfont="MS Sans Serif" var textsize=8 var textcolor="000000"
// The space (pixels) between the letters. If you have chosen a big fontsize you should // you should increase this number. var letterspace=12
// Do not change the variables below var tickerleft=path[path.length-2] var tickertop=path[path.length-1] var timer var finalxpos=tickerleft var i_mes=0 var message="" var i_path=0 var stoptimemilli=stoptime*stoptime+1000 var pathx= new Array()
if (document.layers) { if (textsize>20) {textsize=6} else if (textsize>20) {textsize=5} else if (textsize>14) {textsize=4} else if (textsize>10) {textsize=3} else if (textsize>8) {textsize=2} else if (textsize<=7) {textsize=1} }
var ii=0 for (i=0;i<=path.length-1;i=i+2) { pathx[ii]=path[i] ii++ }
ii=0
var pathy= new Array() for (i=1;i<=path.length-1;i=i+2) { pathy[ii]=path[i] ii++ }
var xpos=new Array() for (i=0;i<=maxtextlength;i++) { xpos[i]=-50 }
var ypos=new Array() for (i=0;i<=maxtextlength;i++) { ypos[i]=-50 }
function makesnake() { if (i_path<=pathx.length-1) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1] ypos[i]=ypos[i-1] } xpos[0]=pathx[i_path] ypos[0]=pathy[i_path] if (document.all) { for (i=0; i<message.length-1; i++) { var thisspan = eval("document.all.span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } } if (document.layers) { for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i] } } i_path++ timer=setTimeout("makesnake()",20) } else { clearTimeout(timer) endposition() } }
function endposition() { if (document.all) { for (i=0; i<message.length-1; i++) { var thisspan = eval("document.all.span"+(i)+".style") thisspan.posLeft=tickerleft+finalxpos thisspan.posTop=tickertop finalxpos+=letterspace } } if (document.layers) { for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=tickerleft+finalxpos thisspan.top=tickertop finalxpos+=letterspace } } timer=setTimeout("clearmessage()",stoptimemilli) }
function clearmessage() { finalxpos=tickertop i_path=0 for (i=0;i<=maxtextlength;i++) { xpos[i]=0 } if (document.all) { for (i=0;i<=maxtextlength;i++) { var thisspan = eval("document.all.span"+i) thisspan.innerHTML=" " var thisspan = eval("document.all.span"+(i)+".style") thisspan.posLeft=xpos[i]=-50 } } if (document.layers) { for (i=0;i<=maxtextlength;i++) { var thisspan = eval("document.span"+i+".document") thisspan.write("<p> </p>") thisspan.clear() thisspan = eval("document.span"+i) thisspan.left=50 } } timer=setTimeout("changemessage()",2000) }
function changemessage() { var messa=mes[i_mes] message=messa.split("") if (document.all) { for (i=0;i<=message.length-1;i++) { var thisspan = eval("document.all.span"+i) thisspan.innerHTML="<p style='font-family:"+textfont+";font-size:"+textsize+";color:"+textcolor+"'>"+message[i]+"</p>" } } if (document.layers) { for (i=0; i<message.length-1; i++) { var thisspan=eval("document.span"+i+".document") thisspan.write("<p><font size="+textsize+" color="+textcolor+" face="+textfont+">"+message[i]+"</font></p>") thisspan.clear() } } i_mes++ if (i_mes>=mes.length) {i_mes=0} finalxpos=tickertop i_path=0 timer=setTimeout("makesnake()",1000) }
// - End of JavaScript - --> </script>
<style>.spanstyle { LEFT: -5000px; POSITION: absolute; VISIBILITY: visible } </style> <meta content="Microsoft FrontPage 3.0" name="GENERATOR"> <title>Летающий текст</title> </head>
<body bgColor="#FFFFFF" onload="changemessage()"> <script> <!-- Beginning of JavaScript - for (i=0;i<=maxtextlength;i++) { document.write("<span id='span"+i+"' class='spanstyle'>") document.write(message) document.write("</span>") }
// - End of JavaScript - --> </script>
</body> </html>
|
|
| |