ВОЛШЕБНАЯ СТРАНА ЛЮБВИ http://helena.maxbb.ru/ |
|
скрипты для сайта http://helena.maxbb.ru/topic516.html |
Страница 5 из 12 |
Автор: | helena [ 03-01, 09:16 ] |
Заголовок сообщения: | |
скрипт дождя: НЕ РААБОТАЕТ <SCRIPT LANGUAGE="JavaScript"> var no = 50; var speed = 1; var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var s, x, y, sn, cs; var a, r, cx, cy; var i, doc_width = 800, doc_height = 600; if (ns4up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } x = new Array(); y = new Array(); r = new Array(); cx = new Array(); cy = new Array(); s = 8; for (i = 0; i < no; ++ i) { initRain(); if (ns4up) { if (i == 0) { document.write("<layer name=\"dot"+ i +"\" left=\"1\" "); document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">"); document.write(",</font></layer>"); } else { document.write("<layer name=\"dot"+ i +"\" left=\"1\" "); document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">"); document.write(",</font></layer>"); } } else if (ie4up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">"); document.write(",</font></div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: "); document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: "); document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">"); document.write(",</font></div>"); } } } function initRain() { a = 6; r[i] = 1; sn = Math.sin(a); cs = Math.cos(a); cx[i] = Math.random() * doc_width + 1; cy[i] = Math.random() * doc_height + 1; x[i] = r[i] * sn + cx[i]; y[i] = cy[i]; } function makeRain() { r[i] = 1; cx[i] = Math.random() * doc_width + 1; cy[i] = 1; x[i] = r[i] * sn + cx[i]; y[i] = r[i] * cs + cy[i]; } function updateRain() { r[i] += s; x[i] = r[i] * sn + cx[i]; y[i] = r[i] * cs + cy[i]; } function raindropNS() { for (i = 0; i < no; ++ i) { updateRain(); if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) { makeRain(); doc_width = self.innerWidth; doc_height = self.innerHeight; } document.layers["dot"+i].top = y[i]; document.layers["dot"+i].left = x[i]; } setTimeout("raindropNS()", speed); } function raindropIE() { for (i = 0; i < no; ++ i) { updateRain(); if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) { makeRain(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } document.all["dot"+i].style.pixelTop = y[i]; document.all["dot"+i].style.pixelLeft = x[i]; } setTimeout("raindropIE()", speed); } if (ns4up) { raindropNS(); } else if (ie4up) { raindropIE(); } </script> |
Автор: | helena [ 03-01, 09:17 ] |
Заголовок сообщения: | |
Скрипт делает рисунки полупрозрачными, но при наведении курсора, возвращает "нормальное" изображение". <SCRIPT> /* Gradual-Highlight Image Script II- By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca) Permission granted to Dynamicdrive.com to feature script in archive For full source to script, visit http://javascript.com */ nereidFadeObjects = new Object(); nereidFadeTimers = new Object(); /* object - image to be faded (actual object, not name); * destop - destination transparency level (ie 80, for mostly solid) * rate - time in milliseconds between trasparency changes (best under 100) * delta - amount of change each time (ie 5, for 5% change in transparency) */ function nereidFade(object, destOp, rate, delta){ if (!document.all) return if (object != "[object]"){ //do this so I can take a string too setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0); return; } clearTimeout(nereidFadeTimers[object.sourceIndex]); diff = destOp-object.filters.alpha.opacity; direction = 1; if (object.filters.alpha.opacity > destOp){ direction = -1; } delta=Math.min(direction*diff,delta); object.filters.alpha.opacity+=direction*delta; if (object.filters.alpha.opacity != destOp){ nereidFadeObjects[object.sourceIndex]=object; nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate); } } </SCRIPT> |
Автор: | helena [ 03-01, 09:18 ] |
Заголовок сообщения: | |
Создает эффект цветных, летящих метеоритов на фоне. <body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" topmargin="0" leftmargin="0"> <script language="JavaScript"> <!-- Space Variation script-made.by.ru if (document.all){ xL=5; xH=0; xW=0; xR=0; xE=0; xMY=0; xMX=0; xWd=0; xHd=0; xF=new Array(); xY=new Array(); xX=new Array(); xS=new Array(); xA=new Array(); xB=new Array(); ini=new Array(); cl=new Array('#fff000','#0000FF','#ff0000','#00ff00','#ff00ff','#ffa500') document.write('<div id="xouter" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < xL; i++){ document.write('<div id="xie" style="position:absolute;top:0;left:0;width:10px;height:10px;' +'font-family:Courier New;font-size:50px;color:#ffffff">.</div>'); } document.write('</div></div>'); function Set(){ for (i=0; i < xL; i++){ xH=window.document.body.offsetHeight; xW=window.document.body.offsetWidth; xA[i]=Math.round(Math.random()*xH); xB[i]=Math.round(Math.random()*xW); xS[i]=Math.random()*0.07+0.05; xR=Math.round(Math.random()*3); xE=Math.round(Math.random()*2500+50) if (xR == 3) xB[i]=-xE; if (xR == 2) xB[i]=xW+xE; if (xR == 1) xA[i]=-xE; if (xR == 0) xA[i]=xH; xF[i]=xW/14; } } Set(); function Assign(){ xouter.style.top=document.body.scrollTop; for (i=0; i < xL; i++){ xF[i]-=xS[i]*25; if (xF[i] < 4) xF[i]=3; xie[i].style.top =xY[i]; xie[i].style.left=xX[i]; xie[i].style.fontSize=xF[i]; xie[i].style.filter='glow(color='+ini[i]+', strength='+xF[i]/3+')'; } } function fly(){ var N=Math.floor(Math.random()*cl.length) xMY=window.document.body.clientHeight/2; xMX=window.document.body.clientWidth/2; xWd=Math.round(Math.random()*40+5); xHd=Math.round(Math.random()*30+5); for (i=0; i < xL; i++) { xY[i]=xA[i]+=(xMY-xA[i])*(xS[i]); xX[i]=xB[i]+=(xMX-xB[i])*(xS[i]); if ((xX[i] > xMX-xWd) && (xX[i] < xMX+xWd) && (xY[i] > xMY-xHd) && (xY[i] < xMY+xHd)){ xH=window.document.body.offsetHeight; xW=window.document.body.offsetWidth; xA[i]=Math.round(Math.random()*xH); xB[i]=Math.round(Math.random()*xW); xS[i]=Math.random()*0.05+0.05; xR=Math.round(Math.random()*3); xE=Math.round(Math.random()*50+50) if (xR == 3) xB[i]=-xE; if (xR == 2) xB[i]=xW+xE; if (xR == 1) xA[i]=-xE; if (xR == 0) xA[i]=xH+xE; } if ((xX[i] < 0) || (xX[i] > xW) || (xY[i] < 0) || (xY[i] > xH)) { xF[i]=xW/14; ini[i]=cl[N]; } } Assign(); setTimeout('fly()',10); } fly(); } // --> </script> |
Автор: | helena [ 03-01, 09:19 ] |
Заголовок сообщения: | |
Эффект летящих звезд: РАБОТАЕТ!!! <body bgcolor="#000000" text="white" link="white" topmargin="0" leftmargin="0" onLoad="fly()"> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin SmallStars = 30; LargeStars = 10; SmallYpos = new Array(); SmallXpos = new Array(); LargeYpos = new Array(); LargeXpos = new Array(); Smallspeed= new Array(); Largespeed= new Array(); ns=(document.layers)?1:0; if (ns) { for (i = 0; i < SmallStars; i++) { document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); } for (i = 0; i < LargeStars; i++) { document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>"); } } else { document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i = 0; i < SmallStars; i++) { document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;height:1px;background:#fffff0;font-size:1px"></div>'); } document.write('</div>'); document.write('</div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i = 0; i < LargeStars; i++) { document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;height:2px;background:#ffffff;font-size:2px"></div>'); } document.write('</div>'); document.write('</div>'); } WinHeight = (document.layers)?window.innerHeight:window.document.body.clientHeight; WinWidth = (document.layers)?window.innerWidth:window.document.body.clientWidth; for (i = 0; i < SmallStars; i++) { SmallYpos[i] = Math.round(Math.random() * WinHeight); SmallXpos[i] = Math.round(Math.random() * WinWidth); Smallspeed[i]= Math.random() * 5 + 1; } for (i = 0; i < LargeStars; i++) { LargeYpos[i] = Math.round(Math.random() * WinHeight); LargeXpos[i] = Math.round(Math.random() * WinWidth); Largespeed[i] = Math.random() * 10 + 5; } function fly() { var WinHeight = (document.layers)?window.innerHeight:window.document.body.clientHeight; var WinWidth = (document.layers)?window.innerWidth:window.document.body.clientWidth; var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop; var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft; for (i = 0; i < LargeStars; i++) { LargeXpos[i] -= Largespeed[i]; if (LargeXpos[i] < -10) { LargeXpos[i] = WinWidth; LargeYpos[i] = Math.round(Math.random() * WinHeight); Largespeed[i] = Math.random() * 10 + 5; } if (ns) { document.layers['ln'+i].left = LargeXpos[i]; document.layers['ln'+i].top = LargeYpos[i] + hscrll; } else { li[i].style.pixelLeft = LargeXpos[i]; li[i].style.pixelTop = LargeYpos[i] + hscrll; } } for (i = 0; i < SmallStars; i++) { SmallXpos[i] -= Smallspeed[i]; if (SmallXpos[i] < -10) { SmallXpos[i] = WinWidth; SmallYpos[i] = Math.round(Math.random()*WinHeight); Smallspeed[i] = Math.random() * 5 + 1; } if (ns) { document.layers['sn'+i].left = SmallXpos[i]; document.layers['sn'+i].top = SmallYpos[i]+hscrll; } else { si[i].style.pixelLeft = SmallXpos[i]; si[i].style.pixelTop = SmallYpos[i]+hscrll; } } setTimeout('fly()', 10); } // End --> </script> |
Автор: | helena [ 03-01, 09:19 ] |
Заголовок сообщения: | |
Красивый салют бьет на вашем фоне: ( не работает, но надо еще раз проверить) <strong><script language="JavaScript"> ns=(document.layers)?1:0; amount=20; if (ns){ for (i=0; i < amount; i++) document.write("<LAYER NAME='nsstars"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); } else{ document.write("<div id='ieCov' style='position:absolute;top:0px;left:0px'>"); document.write("<div style='position:relative'>"); for (i=0; i < amount; i++) document.write("<div id='iestars' style='position:absolute;top:0px;left:0px;width:1;height:1;background:#ffffff;font-size:1'></div>"); document.write("</div></div>"); } Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff') sClrs=new Array('ffa500','00ff00','FFAAFF','fff000','fffffF') Xpos=300; Ypos=150; initialStarColor='00ff00'; step=5; currStep=0; explosionSize=150; function Fireworks(){ var WinHeight=(document.layers)?window.innerHeight-100:window.document.body.clientHeight-100; var WinWidth=(document.layers)?window.innerWidth-100:window.document.body.clientWidth-100; var Yscroll=(document.layers)?window.pageYOffset:document.body.scrollTop; for (i=0; i < amount; i++){ var layer=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; var randCol=Math.round(Math.random()*8); var randSz=Math.round(Math.random()*2); layer.top = Ypos + explosionSize*Math.sin((currStep+i*5)/3)*Math.sin(currStep/100) layer.left= Xpos + explosionSize*Math.cos((currStep+i*5)/3)*Math.sin(currStep/100) if (currStep < 110){ if (ns){layer.bgColor=initialStarColor;layer.clip.width=1;layer.clip.height=1} else{layer.background=initialStarColor;layer.width=1;layer.height=1;layer.fontSize=1} } else{ if (ns){layer.bgColor=Clrs[randCol];layer.clip.width=randSz;layer.clip.height=randSz} else{layer.background=Clrs[randCol];layer.width=randSz;layer.height=randSz;layer.fontSize=randSz} } } if (currStep > 220) { currStep=0; Ypos = 50+Math.round(Math.random()*WinHeight)+Yscroll; Xpos = 50+Math.round(Math.random()*WinWidth); for (i=0; i < sClrs.length; i++) { var newIcol=Math.round(Math.random()*i); } initialStarColor=sClrs[newIcol]; explosionSize=Math.round(80*Math.random()+100); } currStep+=step; setTimeout("Fireworks()",20); } Fireworks(); // --> </script></strong |
Автор: | helena [ 03-01, 09:21 ] |
Заголовок сообщения: | |
Вокруг курсора вращается красивый мигающий круг. Вместе со скриптом выше получается очень красивый эффект! <SCRIPT LANGUAGE="JavaScript"> <!-- Begin ns = (document.layers)?1:0; Clrs = new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff') yBase = 0; xBase = 0; step = 3; currStep = 0; Ypos = 0; Xpos = 0; if (ns){ for (i = 0; i < 14; i++) document.write('<LAYER NAME="n'+i+'" LEFT=0 TOP=0 CLIP="0,0,'+i/4+','+i/4+'"></LAYER>'); window.captureEvents(Event.MOUSEMOVE); function nMouse(evnt){ Ypos = evnt.pageY; Xpos = evnt.pageX; } window.onMouseMove = nMouse; } else{ document.write('<div style="position:absolute;top:0;left:0"><div style="position:relative">'); for (i=0; i < 14; i++) {document.write('<div id="me" style="position:absolute;top:0;left:0;width:'+i/4+';height:'+i/4+';font-size:'+i/4+'"></div>')} document.write('</div></div>'); function iMouse() { Ypos = event.y+document.body.scrollTop; Xpos = event.x+document.body.scrollLeft; } document.onmousemove = iMouse; } function Comet() { var yBase = (document.layers)?window.innerHeight/4:window.document.body.clientHeight/4; var xBase = (document.layers)?window.innerWidth/4:window.document.body.clientWidth/4; for (i = 0; i < 14; i++){ var randCol = Math.round(Math.random()*8); var layer = (document.layers)?document.layers['n'+i]:me[i].style; layer.top =Ypos + yBase*Math.cos((currStep+i*4)/12)*Math.cos(0.7+currStep/200); layer.left = Xpos + xBase*Math.sin((currStep+i*3)/10)*Math.sin(8.2+currStep/400); if (ns) layer.bgColor = Clrs[randCol]; else layer.background = Clrs[randCol]; } currStep += step; setTimeout("Comet()",10); } window.onload = Comet; // End --> </script> </head> <body bgcolor="#000000" text="#FFFFFF"> |
Автор: | helena [ 03-01, 09:22 ] |
Заголовок сообщения: | |
Мигающие ссылки: <strong><script language="JavaScript"> <!-- function initArray() { for (var i = 0; i < initArray.arguments.length; i++) { this[i] = initArray.arguments[i]; } this.length = initArray.arguments.length; } // you may fill this colors array with your colors. // the script will rotate the links through these colors var colors = new initArray( "#CCCCCC", "white", "#CCCCCC", "white", "#CCCCCC", "white", "CCCCCC", "white"); pause_time = .5; // in seconds link = 0; // starting color index (in colors array) for unvisited links vlink = 4; // starting color index (in colors array) for visited links function linkDance() { link = (link+1)%colors.length; vlink = (vlink+1)%colors.length; document.linkColor = colors[link]; document.vlinkColor = colors[vlink]; setTimeout("linkDance();",pause_time*1000); } linkDance(); // --> </script></strong> |
Автор: | helena [ 03-01, 09:22 ] |
Заголовок сообщения: | |
Стиль позволяет изменить цвет полосы прокрутки: <STYLE TYPE="text/css"><!-- body { scrollbar-face-color: #000000; scrollbar-shadow-color: #000000; scrollbar-highlight-color: #00ff00; scrollbar-3dlight-color: #0000ff; scrollbar-darkshadow-color: #ff00ff; scrollbar-track-color: #000000; scrollbar-arrow-color: #00ffff; } --> </STYLE> |
Автор: | helena [ 03-01, 09:23 ] |
Заголовок сообщения: | |
Курсор находится на пересечении двух линий. <style> <!-- #leftright, #topdown{ position: absolute; left: 0; top: 0; width: 1px; height: 1px; layer-background-color: #FF0000; background-color: #FF0000; z-index: 100; font-size: 1px; } --> </style> <div id="leftright" style="width:expression(document.body.clientWidth-2)"></div> <div id="topdown" style="height:expression(document.body.clientHeight-2)"></div> <script language="JavaScript1.2"> <!-- if (document.all&&!window.print){ leftright.style.width=document.body.clientWidth-2 topdown.style.height=document.body.clientHeight-2 } else if (document.layers){ document.leftright.clip.width=window.innerWidth document.leftright.clip.height=1 document.topdown.clip.width=1 document.topdown.clip.height=window.innerHeight } function followmouse1(){ //move cross engine for IE 4+ leftright.style.pixelTop=document.body.scrollTop+event.clientY+1 topdown.style.pixelTop=document.body.scrollTop if (event.clientX<document.body.clientWidth-2) topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1 else topdown.style.pixelLeft=document.body.clientWidth-2 } function followmouse2(e){ //move cross engine for NS 4+ document.leftright.top=e.y+1 document.topdown.top=pageYOffset document.topdown.left=e.x+1 } if (document.all) document.onmousemove=followmouse1 else if (document.layers){ window.captureEvents(Event.MOUSEMOVE) window.onmousemove=followmouse2 } function regenerate(){ window.location.reload() } function regenerate2(){ setTimeout("window.onresize=regenerate",400) } if ((document.all&&!window.print)||document.layers) //if the user is using IE 4 or NS 4, both NOT IE 5+ window.onload=regenerate2 //--> </script> <!-- END OF Mouse Cursor Crosshairs DHTML --> |
Автор: | helena [ 03-01, 09:24 ] |
Заголовок сообщения: | |
Скрипт приветствия: <script language="JavaScript"> <!-- var h=(new Date()).getHours(); if (h > 24 || h < 6) document.write('Доброй ночи!') ; if (h > 6 && h < 12) document.write('Доброе утро!'); if (h > 12 && h < 19) document.write('Добрый день!'); if (h > 19 && h < 24) document. write('Добрый вечер!'); //--> </script> |
Автор: | helena [ 03-01, 09:25 ] |
Заголовок сообщения: | |
Этому сайту уже n-ый день (скрипт отсчитывает время от даты указанной в нем): РАБОТАЕТ <script language="JavaScript"> <!-- site = new Date('Месяц, число, год'); // d = new Date(); date = (d.getTime() - site.getTime()) / (1000*60*60*24); document.write(Math.round(date) + "-й день."); // --> </script> |
Автор: | helena [ 03-01, 09:25 ] |
Заголовок сообщения: | |
Число, месяц, год: <script language="JavaScript"> <!-- time=new Date(); month=(time.getMonth() + 1); date=time.getDate(); year=time.getYear(); if (month < 10) {month = "0" + month } if (date < 10) {date = "0" + date } datastr=( date + "." + month +"." + year ) --> </script> |
Автор: | helena [ 03-01, 09:26 ] |
Заголовок сообщения: | |
Вэб-элементы с подсветкой: (смотри название раздела) <p style="width:100%;font-size:20pt; filter:progid:DXImageTransform.Microsoft.Glow(Color=lime, Strength=1)"> Ваш элемент. </p> |
Автор: | helena [ 03-01, 09:26 ] |
Заголовок сообщения: | |
Поворот изображения на 90;180;270 и т.д. градусов: <img src="Ваш рисунок"alt="Rotated" style="filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=2)"> |
Автор: | helena [ 03-01, 09:27 ] |
Заголовок сообщения: | |
Инвертирование цветов изображения: <img src="Ваш рисунок"alt="Inverted" style="filter:progid:DXImageTransform.Microsoft.BasicImage(Invert=1)"> |
Страница 5 из 12 | Часовой пояс: UTC + 3 часа |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |