гостевая | стихи | песня | автосервис | ссылки |
Секреты Web-Дизайна.Тексты.
Хочу поделиться некоторыми Ява-скриптами. Которые вам могут вполне пригодится на ваших страничках. Буду рад посетить их. Единственное, копировать следует сначала в "блокнот", а затем в код своей страники.
Внешний вид |
Код вставки на страницу |
|
<script> var fs=1 var direction="right" function rollertext(whichone){ var thetext=whichone for (i=0;i<thetext.length;i++){ document.write(thetext.charAt(i).fontsize(fs)) if (fs<7&&direction=="right") fs++ else if (fs==7){ direction="left" fs-- } else if (fs==1){ direction="right" fs++ } else if (fs>1&&direction=="left") fs-- } } //Change below text to your won rollertext("Какие смешные буковки!!!") </script> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://wsabstract.com">Website Abstraction</a></font></p> |
|
<h2> <script language="JavaScript1.2"> var message="А вот и я моя любимая !!!" var neonbasecolor="gray" var neontextcolor="yellow" var flashspeed=100 //in milliseconds ///No need to edit below this line///// var n=0 if (document.all){ document.write('<font color="'+neonbasecolor+'">') for (m=0;m<message.length;m++) document.write('<span id="neonlight">'+message.charAt(m)+'</span>') document.write('</font>') //cache reference to neonlight array var tempref=document.all.neonlight } else document.write(message) function neon(){ //Change all letters to base color if (n==0){ for (m=0;m<message.length;m++) tempref[m].style.color=neonbasecolor } //cycle through and change individual letters to neon color tempref[n].style.color=neontextcolor if (n<tempref.length-1) n++ else{ n=0 clearInterval(flashing) setTimeout("beginneon()",1500) return } } function beginneon(){ if (document.all) flashing=setInterval("neon()",flashspeed) } beginneon() </script> </h2> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://wsabstract.com">Website Abstraction</a></font></p> |
"Начальное приветствие." | <SCRIPT LANGUAGE="JavaScript"> alert(" Добро пожаловать на секреты Web-дизайнера ") </SCRIPT> |
Приставучая надпись | <style type="text/css"> #supertext { position:absolute; left:0; top:0; visibility:hide; visibility:hidden; } </style> <script language="JavaScript1.2"> /* Bouncy message script- By Dynamicdrive.com Code based on Lloyd Hassell's, at http://www.dynamicdrive.com/dynamicindex4/bounceimage.htm For full source, TOS, and 100s DTHML scripts, visit http://dynamicdrive.com */ //Configure the below three variables //1) Set message to display (HTML accepted) var thecontent='<h2><font color="#0000FF">Приставучая надпись!</font></h2>' //2) Set delay after which message should be hidden, in miliseconds ('' makes it incessantly visible on the screen) var hidetimer=''; //3) Set speed of animation (1-50), where larger is faster var BallSpeed = 20; ///NO NEED TO EDIT BELOW THIS LINE/////////// var contentWidth; var contentHeight; var maxBallSpeed = 50; var xMax; var yMax; var xPos = 0; var yPos = 0; var xDir = 'right'; var yDir = 'down'; var superballRunning = true; var tempBallSpeed; var currentBallSrc; var newXDir; var newYDir; function initializeBall() { if (document.all) { xMax = document.body.clientWidth yMax = document.body.clientHeight document.all("supertext").style.visibility = "visible"; contentWidth=supertext.offsetWidth contentHeight=supertext.offsetHeight } else if (document.layers) { xMax = window.innerWidth; yMax = window.innerHeight; contentWidth=document.supertext.document.width contentHeight=document.supertext.document.height document.layers["supertext"].visibility = "show"; } setTimeout('moveBall()',400); if (hidetimer!='') setTimeout("hidetext()",hidetimer) } function moveBall() { if (superballRunning == true) { calculatePosition(); if (document.all) { document.all("supertext").style.left = xPos + document.body.scrollLeft; document.all("supertext").style.top = yPos + document.body.scrollTop; } else if (document.layers) { document.layers["supertext"].left = xPos + pageXOffset; document.layers["supertext"].top = yPos + pageYOffset; } animatetext=setTimeout('moveBall()',20); } } function calculatePosition() { if (xDir == "right") { if (xPos > (xMax - contentWidth - BallSpeed)) { xDir = "left"; } } else if (xDir == "left") { if (xPos < (0 + BallSpeed)) { xDir = "right"; } } if (yDir == "down") { if (yPos > (yMax - contentHeight - BallSpeed)) { yDir = "up"; } } else if (yDir == "up") { if (yPos < (0 + BallSpeed)) { yDir = "down"; } } if (xDir == "right") { xPos = xPos + BallSpeed; } else if (xDir == "left") { xPos = xPos - BallSpeed; } else { xPos = xPos; } if (yDir == "down") { yPos = yPos + BallSpeed; } else if (yDir == "up") { yPos = yPos - BallSpeed; } else { yPos = yPos; } } function hidetext(){ if (document.all) supertext.style.visibility="hidden" else if (document.layers) document.supertext.visibility="hide" clearTimeout(animatetext) } if (document.all||document.layers){ document.write('<span id="supertext"><nobr>'+thecontent+'</nobr></span>') window.onload = initializeBall; window.onresize = new Function("window.location.reload()"); } </script> |
Эфект постепенно открывающихся букв (не сочитается с другими эффектами, поэтому привожу только код) | <script language="JavaScript1.2"> /* Typing Text Script- Last updated: 99/06/17 © Dynamic Drive (www.dynamicdrive.com) For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com */ var it=0 function initialize(){ mytext=typing.innerText var myheight=typing.offsetHeight typing.innerText='' document.all.typing.style.height=myheight document.all.typing.style.visibility="visible" typeit() } function typeit(){ typing.insertAdjacentText("beforeEnd",mytext.charAt(it)) if (it<mytext.length-1){ it++ setTimeout("typeit()",100) } else return } if (document.all) document.body.onload=initialize </script> <small><span id="typing" style="visibility:hidden" align="left">Welcome to Dynamic Drive, the primer place on the net to get FREE Dynamic HTML scripts to enhance your web site! All scripts on this site take advantage of fourth generation browsers (IE 4.x and/or NS 4.x), with emphasis on practicality and backwards compatibility, to bring true power and interactivity to your site. </span></small> |