форум вебмастероff на AlfaSpace.NET |
Ubuntu и Linux
|реактивный бесплатный хостинг
| Киноклуб. ВСЁ БЕСПЛАТНО!
база знаний хостинга
|
правила форума
| Начало ° Ответить ° Статистика ° Опрос ° Регистрация ° Поиск ° FAQ ° |
| Форум вебмастеров на AlfaSpace.NET / Создание сайта / Полезные скрипты |
| << . 1 . 2 . 3 . 4 . >> |
| Автор | Сообщение |
| orc Soul keeper 311 |
# Дата: 27 Дек 2005 06:47 Ну чё и мне тряхнуть стариной? Меняем динамически цвет фона <script> function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = initArray.arguments[i] } var hexChars = "0123456789ABCDEF"; function Dec2Hex (Dec) { var a = Dec % 16; var b = (Dec - a)/16; hex = "" + hexChars.charAt(b) + hexChars.charAt(a); return hex; } function bgChanger (begin, end, steps) { steps = steps -1 ; redA = begin.charAt(0) + begin.charAt(1); red_valA = parseInt(redA,'16'); redB = end.charAt(0) + end.charAt(1); red_valB = parseInt(redB,'16'); red_int = ((red_valB - red_valA) / steps) * -1; grnA = begin.charAt(2) + begin.charAt(3); grn_valA = parseInt(grnA,'16'); grnB = end.charAt(2) + end.charAt(3); grn_valB = parseInt(grnB,'16'); grn_int = ((grn_valB - grn_valA) / steps) * -1; bluA = begin.charAt(4) + begin.charAt(5); blu_valA = parseInt(bluA,'16'); bluB = end.charAt(4) + end.charAt(5); blu_valB = parseInt(bluB,'16'); blu_int = ((blu_valB - blu_valA) / steps) * -1; step = 2; red = red_valA; grn = grn_valA; blu = blu_valA; document.bgColor = begin; while ( steps >= step ) { red -= red_int; red_round = Math.round(red); red_hex = Dec2Hex(red); grn -= grn_int; grn_round = Math.round(grn); grn_hex = Dec2Hex(grn); blu -= blu_int; blu_round = Math.round(blu); blu_hex = Dec2Hex(blu); document.bgColor = red_hex + grn_hex + blu_hex; step++; } document.bgColor = end; } </script> <body bgcolor=#000000 text=#FFFFFF link="FF0000" vlink="8888FF" alink="FF00FF"> <script> <!-- bgChanger("000000","000000",3325); bgChanger("000000","FF0000",3325); bgChanger("FF0000","000000",3325); bgChanger("000000","AA00EE",3325); bgChanger("AA00EE","000000",3325); bgChanger("000000","0000FF",3325); bgChanger("0000FF","000000",3325); bgChanger("000000","000000",3325); // --> </script> |
| orc Soul keeper 311 |
# Дата: 27 Дек 2005 06:48 Красивый скрипт. МАТРИЦА
<style type="text/css"> td {font-weight:bold; font-size:16px; font-family:Courier;} </style> <script language="JavaScript"> <!-- var flag = 0; var countScroll=0; var fs1=16; var fl2=0; var s5 = "1030285493921358430238903284509328560384501100039483216"; var s4 = "2308203278329508097236872736027609702936290760927361809"; var s3 = "3298670709723699709709217369071326136097907136132634823"; var s2 = "0970970970970711342115719076970900101010213697016138348"; var s1 = "0101019359070136097136097091269710927690712967192623154"; var s10 = "1030285493 1358430238 3284509328 0384501100 9483216"; var s9 = "2308203278 9508097236 2736027609 2936290760 7361809"; var s8 = "3298670709 3699709709 7369071326 6097907136 2634823"; var s7 = "0970970970 0711342115 0769709001 0102136970 1383483"; var s6 = "0101019359 0136097136 7091269710 7690712967 2623154"; var s15 = "1 30285493 1358430238 3284509328 0384501100 9483216"; var s14 = "9 08203278 9508097236 2736027609 2936290760 7361809"; var s13 = "6 98670709 3699709709 7369071326 3609790713 3263482"; var s12 = "0 70970970 0711342115 9076970900 1010213697 6138348"; var s11 = "2 01019359 0136097136 7091269710 7690712967 2623154"; var s20 = "4 3285 923 1358430238 3284509328 0384501100 9483216"; var s19 = "2 0203 738 9508097236 2736027609 2936290760 7361809"; var s18 = "0 9670 059 3699709709 7369071326 6097907136 2634823"; var s17 = "5 7970 770 0711342115 9076970900 1010213697 6138348"; var s16 = "9 0019 559 0136097136 7091269710 7690712967 2623154"; var s25 = "4 3 28 903 1358430238 3284509328 0384501100 9483216"; var s24 = "2 0 20 748 9508097236 2736027609 2936290760 7361809"; var s23 = "0 9 67 039 3699709709 7369071326 6097907136 2634823"; var s22 = "5 7 97 770 0711342115 9076970900 1010213697 6138348"; var s21 = "9 0 01 589 0136097136 7091269710 7690712967 2623154"; var s30 = "4 3 8 923 13843 383284 50328 038450 11094 832165"; var s29 = "2 0 0 718 95809 362736 02609 293629 07073 618097"; var s28 = "0 9 7 079 36970 097369 07326 609790 71626 348231"; var s27 = "5 7 7 780 07134 159076 97900 101021 36761 383483"; var s26 = "9 0 1 589 01609 367091 26710 769071 29726 231547"; var s35 = "4 3 923 13843 383284 50328 038450 11094 832165"; var s34 = "2 0 718 95809 362736 02609 293629 07073 618097"; var s33 = "0 9 079 36970 097369 07326 609790 71626 348231"; var s32 = "5 7 780 07134 159076 97900 101021 36761 383483"; var s31 = "9 0 589 01609 367091 26710 769071 29726 231547"; var s40 = "4 3 9 3 13843 383284 50328 0 8450 11094 832165"; var s39 = "2 0 7 8 95809 362736 02609 2 3629 07073 618097"; var s38 = "0 9 0 9 36970 097369 07326 6 9790 71626 348231"; var s37 = "5 7 7 0 07134 159076 97900 1 1021 36761 383483"; var s36 = "9 0 5 9 01609 367091 26710 7 9071 29726 231547"; var s45 = "4 3 9 3 138 3 383284 50328 0 8450 11094 832165"; var s44 = "2 0 7 8 958 9 362736 02609 2 3629 07073 618097"; var s43 = "0 9 0 9 369 0 097369 07326 6 9790 71626 348231"; var s42 = "5 7 7 0 071 4 159076 97900 1 1021 36761 383483"; var s41 = "9 0 5 9 016 9 367091 26710 7 9071 29726 231547"; function ReturnSomeStrings() { if(flag > 5) flag=0; flag++; if(flag==1 && countScroll < 30) return s1; if(flag==2 && countScroll < 30) return s2; if(flag==3 && countScroll < 30) return s3; if(flag==4 && countScroll < 30) return s4; if(flag==5 && countScroll < 30) return s5; else if( countScroll < 30) return s1; if(flag==1 && countScroll > 30 && countScroll < 60) { return s6; } if(flag==2 && countScroll > 30 && countScroll < 60) { return s7; } if(flag==3 && countScroll > 30 && countScroll < 60) { return s8; } if(flag==4 && countScroll > 30 && countScroll < 60) { return s9; } if(flag==5 && countScroll > 30 && countScroll < 60) { return s10;} else if( countScroll > 30 && countScroll < 60) { return s6; } if(flag==1 && countScroll > 60 && countScroll < 90) { document.all.searchDigits.innerText = " 0" ; return s11; } if(flag==2 && countScroll > 60 && countScroll < 90) return s12; if(flag==3 && countScroll > 60 && countScroll < 90) return s13; if(flag==4 && countScroll > 60 && countScroll < 90) return s14; if(flag==5 && countScroll > 60 && countScroll < 90) return s15; else if( countScroll > 60 && countScroll < 90) return s11; if(flag==1 && countScroll > 90 && countScroll < 120) { document.all.searchDigits.innerText = " 0 5" ; return s16; } if(flag==2 && countScroll > 90 && countScroll < 120) return s17; if(flag==3 && countScroll > 90 && countScroll < 120) return s18; if(flag==4 && countScroll > 90 && countScroll < 120) return s19; if(flag==5 && countScroll > 90 && countScroll < 120) return s20; else if( countScroll > 90 && countScroll < 120) return s16; if(flag==1 && countScroll > 120 && countScroll < 140) { document.all.searchDigits.innerText = " 0 2 5" ; return s21; } if(flag==2 && countScroll > 120 && countScroll < 140) return s22; if(flag==3 && countScroll > 120 && countScroll < 140) return s23; if(flag==4 && countScroll > 120 && countScroll < 140) return s24; if(flag==5 && countScroll > 120 && countScroll < 140) return s25; else if( countScroll > 120 && countScroll < 140) return s21; if(flag==1 && countScroll > 140 && countScroll < 150) { document.all.searchDigits.innerText = " 0 25 5" ; return s26; } if(flag==2 && countScroll > 140 && countScroll < 150) return s27; if(flag==3 && countScroll > 140 && countScroll < 150) return s28; if(flag==4 && countScroll > 140 && countScroll < 150) return s29; if(flag==5 && countScroll > 140 && countScroll < 150) return s30; else if( countScroll > 140 && countScroll < 150) return s26; if(flag==1 && countScroll > 150 && countScroll < 170) { document.all.searchDigits.innerText = " 0 2555" ; return s31; } if(flag==2 && countScroll > 150 && countScroll < 170) return s32; if(flag==3 && countScroll > 150 && countScroll < 170) return s33; if(flag==4 && countScroll > 150 && countScroll < 170) return s34; if(flag==5 && countScroll > 150 && countScroll < 170) return s35; else if( countScroll > 150 && countScroll < 170) return s31; if(flag==1 && countScroll > 170 && countScroll < 200) { document.all.searchDigits.innerText = " 0 2555 6 6" ; return s36; } if(flag==2 && countScroll > 170 && countScroll < 200) return s37; if(flag==3 && countScroll > 170 && countScroll < 200) return s38; if(flag==4 && countScroll > 170 && countScroll < 200) return s39; if(flag==5 && countScroll > 170 && countScroll < 200) return s40; else if( countScroll > 170 && countScroll < 200) return s36; if(flag==1 && countScroll > 200 && countScroll < 260) { document.all.searchDigits.innerText = " 0 2555 6 0 8" ; return s41; } if(flag==2 && countScroll > 200 && countScroll < 260) return s42; if(flag==3 && countScroll > 200 && countScroll < 260) return s43; if(flag==4 && countScroll > 200 && countScroll < 260) return s44; if(flag==5 && countScroll > 200 && countScroll < 260) return s45; else if( countScroll > 200 && countScroll < 260) return s41; else return " "; } function FillScreen() { clearTimeout('ShowHide()',300); clearTimeout('BuildPhrase()',50); var FS = ""; for(i=0;i<20;i++) { FS += ReturnSomeStrings(); FS += "\n"; } document.all.tt.innerText = FS; document.all.tt.style.fontSize=fs1; document.all.nu.style.fontSize=fs1; document.all.searchDigits.style.fontSize=fs1; fl2++; if(fl2>200) { fs1+=2; } countScroll++; if(countScroll >= 260) { clearTimeout('FillScreen()',50); Flash(); return; } setTimeout('FillScreen()',50); } function Flash() { document.all.failure.style.cssText="display:show"; } var stat=0; var intCounter=0; var intColCounter=11; var Phrase; Phrase = "Wake up alfaspace.net!"; var tempPhrase= ""; var counterPass=0; var HowPhrase=0; var pLength= Phrase.length; var img1 = new Image(); img1.src = "Dot1.gif"; var img2 = new Image(); img2.src = "Dot1.gif"; function ShowHide() { if(intCounter==intColCounter) { setTimeout('BuildPhrase()',50); return; |
| SpiriTzzz Темный джедай 1382 |
# Дата: 27 Дек 2005 08:56 по мойму он не влез до конца ))) |
| orc Soul keeper 311 |
# Дата: 27 Дек 2005 14:14 ага
часть 2
------------------------ } intCounter++; if(stat==0) { document.all.dot.src=img1.src; stat=1; } else { document.all.dot.src=img2.src; stat=0; } setTimeout('ShowHide()',300); } function BuildPhrase() { if(HowPhrase > 1) { document.all.Matrix.style.cssText="display:none"; document.all.dot.style.cssText="display:none"; document.all.nextStep.style.cssText="display:show"; FillScreen(); return; } if(intCounter < intColCounter) {setTimeout('ShowHide()',300);return;} setTimeout('BuildPhrase()',50); var Source = ""; var SourceLength; Source=Phrase; SourceLength = pLength; tempPhrase =" " + Source.substring(0,counterPass); document.all.Matrix.innerText = tempPhrase; counterPass+=1; if(counterPass == SourceLength+1) { intColCounter=5; intCounter=-1; counterPass=0; Phrase="Trace program: running"; HowPhrase++; } } </script> </head> <body bgcolor=#000000 text=green topmargin=20 leftmargin=20 rightmargin=20 onLoad="ShowHide();"> <basefont face="Courier New, Times New Roman, Arial, Helvetica, Ms Sans Serif"> <div id="failure" style="position:absolute;z-index:100; top:50;left:50;display:none;"><font style="font-size:50px;font-weight:bold;color:yellow;">SYSTEM FAILURE</font></div> <span id="Matrix" style="font-weight:bold; font-size:12pt"></span><img src="Dot1.gif" height=15 name="dot" id="dot"> <div id="nextStep"style="display:none"> <table border=0 width=10000 cellspacing=0 cellpadding=0 align=center> <tr> <td > <div style="color:#000000" id="nu">0</div> </td> <td align=left width=10000 id="searchDigits" style="font-weight:bold; font-size:12px;"> </td> </tr> </table> <table border=0 width=10000 align=center cellspacing=0 cellpadding=0> <tr> <td> <span id="tt" style="font-weight:bold; font-size:12px;"> </span> </td> </tr> </table> </div> </body> </html> |
| orc Soul keeper 311 |
# Дата: 28 Дек 2005 00:24 Жуткий скрипт
Отображение инфы о броузере <script language=JavaScript> document.write("Browser Codename: ", navigator.appCodeName); document.write("<br>Browser Name: ", navigator.appName); document.write("<br>Browser Version: ", navigator.appVersion); </script> |
| orc Soul keeper 311 |
# Дата: 28 Дек 2005 00:26 Конвертация числа из двоичной системы в десятичную, восьмиричную и в хрен-знает-какую ещё.
<script language="JavaScript"> var hex = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"); function CKparseInt(n, r) { for (var i = 0; i < n.length; ++i) if (n.charAt(i) >= r) { alert("Invalid digit"); return 0; } if (isNaN(M = parseInt(n, r))) alert ("Invalid number"); return M; } function DecimaltoAnother(A, radix) { s = ""; while (A >= radix) { s += hex[A % radix]; A = Math.floor(A / radix); } return transpose(s += hex[A]); } function transpose(s) { N = s.length; for (i = 0,t = ""; i < N; i++) t += s.substring(N-i-1, N-i); return t; } function EvalAny(item, r) { M = CKparseInt(item.value, r); for (var i = 0, MyForm = document.forms[0]; i < MyForm.length; ++i) // re-evaluate all MyForm.elements[i].value = DecimaltoAnother(M, MyForm.elements[i].name.substr(1,3)); } </script> <body> <center> <h3>Конвертация чисел</h3><br> <form method="post"> <table border=0 align=center> <tr> <td align=right><p>Двоичный:</p></td> <td><input name="b002" value="0" onChange="EvalAny(this, 2)" size=27></input></td> </tr> <tr> <td align=right>Троичный:</td> <td><input name="t003" value="0" onChange="EvalAny(this, 3)" size=21></input></td> </tr> <tr><td align=right>Пятиричный:</td> <td><input name="q005" value="0" onChange="EvalAny(this, 5)" size=16></input></td> </tr> <tr> <td align=right>Восьмиричный:</td> <td><input name="o008" value="0" onChange="EvalAny(this, 8)" size=12></input></td> </tr> <tr> <td align=right>Десятичный:</td> <td><input name="d010" value="0" onChange="EvalAny(this, 10)" size=11></input></td> </tr> <tr> <td align=right>Шеснадцатиричный:</td> <td><input name="h016" value="0" onChange="EvalAny(this, 16)" size=8></input></td> </tr> </table> </form> </center> <p>Для изменений кликните по любой ячейке |
| orc Soul keeper 311 |
# Дата: 28 Дек 2005 00:27 ° Поправил: orc Эффектный скрипт создающий выпадающее меню <style> body{background-color:#FFFFFF} A{color:Navy; text-decoration:none} A:hover{color:red} A:visited:{color:#808080} TD{font-family:arial,helvetica; font-size:10pt} DIV.clTopMenu{position:absolute; width:101; height:150; clip:rect(0,101,14,0); visibility:hidden; z-index:31; layer-background-color:#EEEEEE; background-color:#EEEEEE} DIV.clTopMenuBottom{position:absolute; width:101; height:3; clip:rect(0,101,3,0); top:11; layer-background-color:#CECFCE; background-color:#CECFCE; z-index:2} DIV.clTopMenuText{position:absolute; width:91; left:5; top:15; font-family:arial,helvetica; font-size:11px; background-color:#EEEEEE; z-index:1} </style> <script> /*Browsercheck:*/ ie=document.all?1:0 n=document.layers?1:0 /********************************************************************* *********** If you want to change the appearens on the text, background-colors, size or anything do that in the style tag above. This menu might not be as easy to adapt to your own site, but please play around with it before you mail me for help ********************************************************************** ******/ /********************************************************************* ****** Variables to set. ********************************************************************** ******/ //How many menus do you have? (remember to copy and add divs in the body if you add menus) var numberOfMenus=2 //The width on the menus (set the width in the stylesheet as well) var mwidth=101 //Pixels between the menus var pxBetween=10 //The first menus left position var fromLeft=20 //The top position of the menus var fromTop=10 //The bgColor of the bottom mouseover div var bgColor='#CECFCE' //The bgColor to change to var bgColorChangeTo='#6380BC' //The position the mouseover line div will stop at when going up! var imageHeight=11 /********************************************************************* ****** You shouldn't have to change anything below this ********************************************************************** ******/ //Object constructor function makeNewsMenu(obj,nest){ nest=(!nest) ? '':'document.'+nest+'.' this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style') this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj +'.offsetHeight') this.moveIt=b_moveIt;this.bgChange=b_bgChange; this.slideUp=b_slideUp; this.slideDown=b_slideDown; this.clipTo=b_clipTo; this.obj = obj + "Object"; eval(this.obj + "=this") } //Objects methods function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y} function b_bgChange(color){if(ie) this.css.backgroundColor=color; else this.css.bgColor=color} function b_clipTo(t,r,b,l){ if(n){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l }else this.css.clip="rect("+t+","+r+","+b+","+l+")"; } function b_slideUp(ystop,moveby,speed,fn,wh){ if(!this.slideactive){ if(this.y>ystop){ this.moveIt(this.x,this.y-5); eval(wh) setTimeout(this.obj+".slideUp("+ystop+","+moveby+","+speed+",'"+fn+ "','"+wh+"')",speed) }else{ this.slideactive=false; this.moveIt(0,ystop); eval(fn) } } } function b_slideDown(ystop,moveby,speed,fn,wh){ if(!this.slideactive){ if(this.y<ystop){ this.moveIt(this.x,this.y+5); eval(wh) setTimeout(this.obj+".slideDown("+ystop+","+moveby+","+speed+",'"+f n+"','"+wh+"')",speed) }else{ this.slideactive=false; this.moveIt(0,ystop); eval(fn) } } } //Initiating the page, making cross-browser objects function newsMenuInit(){ oTopMenu=new Array() for(i=0;i<=numberOfMenus;i++){ oTopMenu[i]=new Array() oTopMenu[i][0]=new makeNewsMenu('divTopMenu'+i) oTopMenu[i][1]=new makeNewsMenu('divTopMenuBottom'+i,'divTopMenu'+i) oTopMenu[i][2]=new makeNewsMenu('divTopMenuText'+i,'divTopMenu'+i) oTopMenu[i][1].moveIt(0,imageHeight) oTopMenu[i][0].clipTo(0,mwidth,imageHeight+3,0) oTopMenu[i][0].moveIt(i*mwidth+fromLeft+(i*pxBetween),fromTop) oTopMenu[i][0].css.visibility="visible" } } //Moves the menu function topMenu(num){ if(oTopMenu[num][1].y==imageHeight) oTopMenu[num][1].slideDown(oTopMenu[num][2].scrollHeight+20,10,40,'oTo pMenu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)','oTopMe nu['+num+'][0].clipTo(0,mwidth,oTopMenu['+num+'][1].y+3,0)') else if(oTopMenu[num][1].y==oTopMenu[num][2].scrollHeight+20) oTopMenu[num][1].slideUp(imageHeight,10,40,'oTopMenu['+num+'][0].clipT o(0,mwidth,oTopMenu['+num+'][1].y+3,0)','oTopMenu['+num+'][0].clipTo(0 ,mwidth,oTopMenu['+num+'][1].y+3,0)') } //Changes background onmouseover function menuOver(num){oTopMenu[num][1].bgChange(bgColorChangeTo)} function menuOut(num){oTopMenu[num][1].bgChange(bgColor)} //Calls the init function onload onload=newsMenuInit; </script> </head> <body> <!-- Remember the "news" "key control" and "page contols" text are images, you probably want to change those with your own images. If your own images have different sizes please adjust the height and clips of the divs, and change the imageHeight variable in the script. Good luck --> <div id="divTopMenu0" class="clTopMenu"><a href="#" onmouseover="menuOver(0)" onmouseout="menuOut(0)" onclick="topMenu(0); if(ie)this.blur(); return false"><img src="news.gif" width=101 height=11 alt="" border=0 align="top"></a> <div id="divTopMenuText0" class="clTopMenuText"> Added some link to me buttons and advertising info and a new script and a new tutorial.<br><br> Remember to join the newsletter! </div> <div id="divTopMenuBottom0" class="clTopMenuBottom"></div> </div> <div id="divTopMenu1" class="clTopMenu"><a href="#" onmouseover="menuOver(1)" onmouseout="menuOut(1)" onclick="topMenu(1); if(ie)this.blur(); return false"><img src="keycontrol.gif" width=101 height=11 alt="" border=0 align="top"></a> <div id="divTopMenuText1" class="clTopMenuText"> 1-6=Menu controls<br> M=Menuchange<br> N=News<br> K=Key controls<br> P=Page control<br> A=Scroll down<br> Z=Scroll up<br> S=Scriptomania<br><br> </div> <div id="divTopMenuBottom1" class="clTopMenuBottom"></div> </div> <div id="divTopMenu2" class="clTopMenu"><a href="#" onmouseover="menuOver(2)" onmouseout="menuOut(2)" onclick="topMenu(2); if(ie)this.blur(); return false"><img src="pagecontrol.gif" width=101 height=11 alt="" border=0 align="top"></a> <div id="divTopMenuText2" class="clTopMenuText"> <a href="#" onclick="changeMenu(); return false">Меню</a> </div> <div id="divTopMenuBottom2" class="clTopMenuBottom"></div> </div> <!-- To add a new menu just copy these lines: <div id="divTopMenuN" class="clTopMenu"><a href="#" onmouseover="menuOver(N)" onmouseout="menuOut(N)" onclick="topMenu(N); if(ie)this.blur(); return false">HEADING IMAGE GOES HERE</a> <div id="divTopMenuTextN" class="clTopMenuText"> TEXT HERE </div> <div id="divTopMenuBottomN" class="clTopMenuBottom"></div> </div> And change the letter N to a number higher then the last menu... (and remember to set the variable numberOfMenus in the script to the same number of menus you have (remember it starts counting at 0) --> |
| orc Soul keeper 311 |
# Дата: 28 Дек 2005 00:30 Скрипт показывает текущую дату <script language="JavaScript"> function getDateNow() { var now = new Date(); var e = now.getDate(); d = e + ' '; var month = new Array(13); month[1] = "января"; month[2] = "февраля"; month[3] = "марта"; month[4] = "апреля"; month[5] = "мая"; month[6] = "июня"; month[7] = "июля"; month[8] = "августа"; month[9] = "сентября"; month[10] = "октября"; month[11] = "ноября"; month[12] = "декабря"; var day = new Array(7); day[0]= "воскресенье"; day[1]= "понедельник"; day[2]= "вторник"; day[3]= "среда"; day[4]= "четверг"; day[5]= "пятница"; day[6]= "суббота"; nday=day[now .getDay()] nmonths =month[ (now.getMonth() + 1)]; d += nmonths + ', ' +nday ; return 'Сегодня ' + d+' ' ; } //Time town //--------- var times = new Array(96); times[0] = "0:00"; times[1] = "0:15"; times[2] = "0:30"; times[3] = "0:45"; times[4] = "1:00"; times[5] = "1:15"; times[6] = "1:30"; times[7] = "1:45"; times[8] = "2:00"; times[9] = "2:15"; times[10] = "2:30"; times[11] = "2:45"; times[12] = "3:00"; times[13] = "3:15"; times[14] = "3:30"; times[15] = "3:45"; times[16] = "4:00"; times[17] = "4:15"; times[18] = "4:30"; times[19] = "4:45"; times[20] = "5:00"; times[21] = "5:15"; times[22] = "5:30"; times[23] = "5:45"; times[24] = "6:00"; times[25] = "6:15"; times[26] = "6:30"; times[27] = "6:45"; times[28] = "7:00"; times[29] = "7:15"; times[30] = "7:30"; times[31] = "7:45"; times[32] = "8:00"; times[33] = "8:15"; times[34] = "8:30"; times[35] = "8:45"; times[36] = "9:00"; times[37] = "9:15"; times[38] = "9:30"; times[39] = "9:45"; times[40] = "10:00"; times[41] = "10:15"; times[42] = "10:30"; times[43] = "10:45"; times[44] = "11:00"; times[45] = "11:15"; times[46] = "11:30"; times[47] = "11:45"; times[48] = "12:00"; times[49] = "12:15"; times[50] = "12:30"; times[51] = "12:45"; times[52] = "13:00"; times[53] = "13:15"; times[54] = "13:30"; times[55] = "13:45"; times[56] = "14:00"; times[57] = "14:15"; times[58] = "14:30"; times[59] = "14:45"; times[60] = "15:00"; times[61] = "15:15"; times[62] = "15:30"; times[63] = "15:45"; times[64] = "16:00"; times[65] = "16:15"; times[66] = "16:30"; times[67] = "16:45"; times[68] = "17:00"; times[69] = "17:15"; times[70] = "17:30"; times[71] = "17:45"; times[72] = "18:00"; times[73] = "18:15"; times[74] = "18:30"; times[75] = "18:45"; times[76] = "18:00"; times[77] = "19:15"; times[78] = "19:30"; times[79] = "19:45"; times[80] = "20:00"; times[81] = "20:15"; times[82] = "20:30"; times[83] = "20:45"; times[84] = "21:00"; times[85] = "21:15"; times[86] = "21:30"; times[87] = "21:45"; times[88] = "22:00"; times[89] = "22:15"; times[90] = "22:30"; times[91] = "22:45"; times[92] = "23:00"; times[93] = "23:15"; times[94] = "23:30"; times[95] = "23:45"; times[96] = "42:00"; function CTime(form) { var day = ', этого дня'; var baseCityTime = 30 * parseInt(form.timeChoice.options[form.timeChoice.selectedIndex].value) ; var offset = parseInt(form.firstCity.options[form.firstCity.selectedIndex].value ) - parseInt(form.secondCity.options[form.secondCity.selectedIndex].valu e); var selectedCityTime = (baseCityTime - offset) / 30; var targetTime = parseInt(form.timeChoice.options[form.timeChoice.selectedIndex].value ) + selectedCityTime; if (selectedCityTime < 0) { selectedCityTime = 48 + selectedCityTime; day = ', предыдущего дня'; } else if (selectedCityTime > 47) { selectedCityTime = selectedCityTime - 48; day = ', следующего дня'; } if (selectedCityTime < 0) selectedCityTime=selectedCityTime * -1; form.time.value = times[selectedCityTime * 2] + day; return false; } </script> <script language="JavaScript">document.write('<small>'+getDateNow()+'</small>' )</script> |
| orc Soul keeper 311 |
# Дата: 28 Дек 2005 00:32 Ну я думаю что хватит с вас на сегодня. Скриптов у меня много, буду постепенно выкладывать. ![]() |
| silen The Majestic 516 |
# Дата: 5 Янв 2006 19:51 для выпадающего меню лучше прогу использовать ........sothink dhtml menu/// !супер прога |
| Vitaslon Участник 532 |
# Дата: 6 Янв 2006 05:56 тему не стал создавать нужен скрипт чтобы вёл статистику кто кликнул на банер(ip) и когда если есть у кого выложите плиз |
| Roler USA Hater 1303 |
# Дата: 22 Мар 2006 12:28 Хочу ещё! ![]() |
| kepa Участник 43 |
# Дата: 27 Мар 2006 20:10 По больше бы о PHP !!!! |
| Михаил Ушел в бан) 2549 |
# Дата: 2 Апр 2006 07:17 ° Поправил: Михаил Этот скрипт приветствует входящего, может кому-нибудь нужен будет... <script language=JavaScript> var h=(new Date()).getHours(); if (h > 23 || h < 7) document.write("Доброй ночи!"); if (h > 6 && h < 12) document.write("С добрым утром!"); if (h > 11 && h < 19) document.write("Добрый день!"); if (h > 18 && h < 24) document. write("Добрый вечер!"); </script> ------------------------------------------------------------------------- A это часы Добавьте нижеследующий код в строку <head> страницы <script Language="JavaScript"> <!-- hide var timeStr, dateStr; function clock() { now= new Date(); hours= now.getHours(); minutes= now.getMinutes(); seconds= now.getSeconds(); timeStr= "" + hours; timeStr+= ((minutes < 10) ? ":0" : ":") + minutes; timeStr+= ((seconds < 10) ? ":0" : ":") + seconds; document.all.item("cl").innerHTML = timeStr; Timer= setTimeout("clock()",1000); } // --> </script> потом: Заменишь строку <body> твоей страницы на вот эту: <body onload="clock();"> Вставишь этот код в любое место раздела <body> <p align="left" id="cl"></p> ------------------------------------------------------------------------ Сумашедший статус бар (Откуда взял - не помню.. Может понравиться) <head> <title>Сумашедший статусбар</title> </head> <body bgcolor="#FFFFFF" onload="start()"> <script language="JavaScript"> <!-- Hiding var letters= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9","A", "Б", "В", "Г", "Д", "Е", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ч", "Щ", "У", "Я","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","!","@","#","$","%","^","&","*","(",")","_","-","+","=","<",">","/","?","®", "©") var smessage="" var message= new Array(); var msg=0; message[0]='первое сообщение' message[1]='второе сообщение' message[2]='третье сообщение' function start(){ for (y=0; y<message[msg].length; y++){ for (x=0; x<20; x++){ rnum=Math.random(); rnum*=letters.length-1 rnum=Math.round(rnum) window.status=smessage+letters[rnum] for (del=0; del<20; del++){} } smessage+=message[msg].substring(y,y+1) window.status=smessage; } window.setTimeout('clrdspl()',2000); } function clrdspl(){ smessage=""; window.status=""; if (msg<message.length-1){ msg++; start(); } else{ msg=0; window.setTimeout('start()',1000) } } // Done Hiding --> </script> </body> </html> ---------------------------------------------------- паролирование страниц: <script language="JavaScript"> if (top.location.search=="") { pass = prompt('Введите пароль'); if (pass=='пароль сюда') { alert('Пароль принят') } else { alert('Пароль непринят!'), top.location.href="не верный пароль.htm" } }; </script> <html> ------------------------------------------------------ пока все! |
| Jizus CREED Участник 684 |
# Дата: 2 Апр 2006 16:38 Калькулятор моего изобретения. По моему, неплохой))) <html>
<head> <title>[JC] JavaCalculator v 1.0</title> <link href="main.css" type="text/css" rel="stylesheet"> </head> <body align=center> <!-- 1 - сложение 2 - вычитание 3 - умножение 4 - деление --> <script language="javascript"><!-- var output=0; // вволимая строка (первоначальная) var m=0; // отвечает за добавляемую цифру или символ var action=0; // номер совершаемого мат. действия var out1="0"; // вводимая строка (после прибавления m). также используется в некоторых мат. функциях. var resultkol=0; // отображает, было ли уже нажатие на "=" в этом действии. var actionkol=0; // при нажатии на знак, отвечает за отображение того, первый ли раз нажато действие. var mem=0; // Переменная, содержащая в себе собственно память калькулятора. var mem1=0; // При "1" - память занята. При "0" память пуста. function backdoor() {out1=output + m; out1 *=1;document.form1.outputline.value=out1; output=document.form1.outputline.value;}; function result() {if (resultkol == 0) {v2=out1}; v2 *=1; if (action == "1") {out1=v1+v2;} if (action == "2") {out1=v1-v2;} if (action == "3") {out1=v1*v2;} if (action == "4") {out1=v1/v2;}; document.form1.outputline.value=out1; v1=out1;}; function plus() {if (actionkol==0) {action=1; act();} else {act(); action=1;};}; function minus() {if (actionkol==0) {action=2; act();} else {act(); action=2;};}; function umnoj() {if (actionkol==0) {action=3; act();} else {act(); action=3;};}; function delen() {if (actionkol==0) {action=4; act();} else {act(); action=4;};}; function act() {if (actionkol==0) {v1=out1; v1 *=1; out1="0"; output=0;} else {result();out1="0"; output=0;}; actionkol=1; document.form1.drob.disabled=false; resultkol=0;}; function nool() {if (out1 != "0" || out1 != 0) {m=0; backdoor2()};}; function cleen() {out1=0; output=out1; document.form1.outputline.value=out1; newact(); document.form1.drob.disabled=false; actionkol=0; resultkol=0;}; function protiv() {out1=output*-1; document.form1.outputline.value=out1; output=document.form1.outputline.value;}; function back() {document.form1.outputline.value=out1;}; function newact() {resultkol=0; actionkol=0;}; function obratn() {out1=1/output; document.form1.outputline.value=out1; output=document.form1.outputline.value ;}; function backdoor2() {out1=output + m; document.form1.outputline.value=out1; output=document.form1.outputline.value;}; function sqrt() {out1= Math.sqrt(output); document.form1.outputline.value=out1; output=document.form1.outputline.value;}; function mr() {if (mem1==1) {out1=mem; document.form1.outputline.value=out1; output=document.form1.outputline.value};}; function mc() {mem=0; mem1=0; document.form1.emka.value=('');}; function mplus() {output*=1; if (output!=0) {mem1=1; mem+=output; document.form1.emka.value=('M !')};}; function ms() {output*=1; if (output!=0) {mem1=1; mem=output; document.form1.emka.value=('M !')};}; function prozent() {v2=out1; v2 *=1; out1=(v1/100)*v2; document.form1.outputline.value=out1;}; --></script> <table align=center> <td> <form id=form1 name="form1"><table align=center> <td><input type=button value="" id="emka" class="m"></td> <td colspan=6 height=40><input class="in" id="outputline" value="0" maxlength=0 type=text onclick="back()"></td> <td><input type=button value="C" onclick="cleen()" title="Очистить"></td> <tr> <td><input type=button value="MC" onclick="mc();" title="Очистить память"></td> <td rowspan=6> </td> <td><input type=button value="7" onclick="m=7; backdoor()"></td> <td><input type=button value="8" onclick="m=8; backdoor()"></td> <td><input type=button value="9" onclick="m=9; backdoor()"></td> <td rowspan=6> </td> <td><input type=button value="/" onclick="delen()" title="Частное"></td> <td><input type=button value="sqrt" onclick="sqrt();" title="Извлечь квадратный корень"></td> <tr> <td><input type=button value="MR" onclick="mr();" title="Вывести содержимое памяти"></td> <td><input type=button value="4" onclick="m=4; backdoor()"></td> <td><input type=button value="5" onclick="m=5; backdoor()"></td> <td><input type=button value="6" onclick="m=6; backdoor()"></td> <td><input type=button value="X" onclick="umnoj()" title="Произведение"></td> <td><input type=button value="%" onclick="prozent(); actionkol=0;" title="Найти процент"></td> <tr> <td><input type=button value="MS" onclick="ms()" title="Занести в память"></td> <td><input type=button value="1" onclick="m=1; backdoor()"></td> <td><input type=button value="2" onclick="m=2; backdoor()"></td> <td><input type=button value="3" onclick="m=3; backdoor()"></td> <td><input type=button value="-" onclick="minus()" title="Разность"></td> <td><input type=button value="1/X" onclick="obratn()" title="Сделать число обратным ему"></td> <tr> <td><input type=button value="M+" onclick="mplus();" title="Прибавить к памяти"></td> <td><input type=button value="+/-" onclick="protiv()" title="сделать отрицательным/положительным"></td> <td><input type=button value="0" onclick="nool()"></td> <td><input type=button id="drob" value="." onclick="m='.'; backdoor2(); document.form1.drob.disabled='true';" title="Дробная часть"></td> <td><input type=button value="+" onclick="plus()" title="Сумма"></td> <td><input type=button value="=" onclick="result(); resultkol=1; actionkol=0;" title="РЕЗУЛЬТАТ"></td> <tr> <td colspan=8 align=center><a href="http://huligan.alfamoon.com" target="_blank" title="[JC]JavaCalc v 1.0 от [JC]Development. Перейти На сайт Разработчика Скрипта">[JC]Development 2005-2006©</a></td> </table> </form></td></table> </body> </html> в той же дире нуна создать файл main.css с примерно таким содержимым (ктоз захочет - стиль сменит ))) ) .in {
width: 114px; BORDER: #000000 1px solid; FONT: 9px verdana, tahoma, arial, helvetica, sans-serif; COLOR: #000000; BACKGROUND-COLOR: #ffcc00; TEXT-ALIGN: right } body { background-color: black; } input { width: 22px; BORDER: #FFcc00 1px solid; FONT: 9px verdana, tahoma, arial, helvetica, sans-serif; COLOR: #ffffff; BACKGROUND-COLOR: #000000; TEXT-ALIGN: center } form { border: #ffcc00 1px solid; width: 185px; } .m { BORDER: #000000; FONT: 12px verdana, tahoma, arial, helvetica, sans-serif; COLOR: #ffcc00; font-weight: bold; BACKGROUND-COLOR: #000000; } a:link { font-size: 10 px; color: #ffcc00; } a:visited { font-size: 10 px; color: #ddbb00; } a:hover { font-size: 10 px; color: #ffffff; } |
| orc Soul keeper 311 |
# Дата: 10 Апр 2006 13:46 » Jizus CREED Калькулятор моего изобретения![]() |
| orc Soul keeper 311 |
# Дата: 10 Апр 2006 13:52 Картинки рандомом function goRand() {
var num = 3; // количество картинок
myImages = new Array();
myImages[0] = "image1.gif";
myImages[1] = "image2.gif";
myImages[2] = "image3.gif";
rand = Math.floor(Math.random() * num);
current_image = myImages[rand];
}Вызов: <script>
goRand();
document.write("<img src=\"" + current_image + "\">")
</script> |
| Jizus CREED Участник 684 |
# Дата: 10 Апр 2006 15:28 orc Всё моё до последней строчки
Мож ты где то это видел, потому что кардинально по другому и не сделаешь? |
| greywarior aka Maximka 379 |
# Дата: 15 Июн 2006 14:23 ° Поправил: greywarior Не мой, но очень интересный скрипт, делающий картинку полупрозрачной, но когда на неё наводишь мышку она постепенно становится нормальной! Это в хедер: <script>
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> А это в тэг картинки, например: <img onmouseover=nereidFade(this,100,30,5) style="FILTER: alpha(opacity=40)" onmouseout=nereidFade(this,40,50,5) src="IVE/art/L_topics.gif" width="130" height="14" border="0"> |
| Roler USA Hater 1303 |
# Дата: 16 Июн 2006 06:28 greywarior А джавой и двумя картинками не легче? |
| SpiriTzzz Темный джедай 1382 |
# Дата: 16 Июн 2006 17:02 Roler нет, ибо: 1) трафик 2) он подгружает картинку НАЛЕТУ, что не очень мне (и многим) нарвится ![]() |
| 4mlr Участник 276 |
# Дата: 2 Авг 2006 16:14 Здравствуйте. Я можете, пожалуйста, написать скрипт на Яве, чтоб объект, скажем таблица, всё время отображался в одном из углов браузера... тоесть юзер ползает по сайту, а сверху слева таблица... |
| Андрей Алексеевич 2123 |
# Дата: 2 Авг 2006 16:32
<script>
document.body.onScroll = function(){
var div = document.getElementById('sverhusleva');
div.style.top = 0;
div.style.left = 0;
}
<div id="sverhusleva" style="position: absolute; top: 0; left: 0; width: 100px; Пример чисто «для примера». Работать будет едва ли, но основная идея должна быть ясна. |
| orc Soul keeper 311 |
# Дата: 3 Авг 2006 00:44 Будем подымать тему --------------- Переливающиеся ссылки Скрипт вставляется в заголовок между тэгами <head> и </head> <script language="JavaScript">
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++) {
this[i] = initArray.arguments[i];
}
this.length = initArray.arguments.length;
}
var colors = new initArray(
"red",
"blue",
"green",
"purple",
"black",
"tan",
"red");
delay = .5; // seconds
link = 0;
vlink = 2;
function linkDance() {
link = (link+1)%colors.length;
vlink = (vlink+1)%colors.length;
document.linkColor = colors[link];
document.vlinkColor = colors[vlink];
setTimeout("linkDance()",delay*1000);
}
linkDance();
// End -->
</script>
|
| 4mlr Участник 276 |
# Дата: 4 Авг 2006 02:57 Андрей Абсолитные значение координат не зависят от того куда уехал юзер... оно всегда в левом углу остаётся. А ни у кого нет рабтающего скрипта такого типа? |
| Андрей Алексеевич 2123 |
# Дата: 4 Авг 2006 04:01 4mlr left - будет 0, а top попробуй через document.getElementsByTagName( 'body' )[0].scrollTop + "px" Но это только на ie сработает вроде бы. |
| 4mlr Участник 276 |
# Дата: 5 Авг 2006 01:21 Андрей неа... чё-то не пашет.... |
| Sonix Участник 213 |
# Дата: 7 Авг 2006 17:31 а ещо есть полезные и интересные скрипты ??? хочу ещо
или раскажите где их можно посмотреть и выбрать .... |
| Dimash Участник 9 |
# Дата: 10 Сен 2006 02:31 Ребята.. а мне вот нужен совсем простой скрипт )) При нажатии на ссылку открывается новое окно с заданными мною размерами И можно ли его сделать не юзая java ? Если нет то можно и java ![]() |
| acsid Alfa Guru 2410 |
# Дата: 10 Сен 2006 02:49
function link() {
ws=screen.width;
hs=screen.height;
l=(ws-500)/2; ---место открытия окна на мониторе
t=(hs-320)/2-50;---место открытия окна на мониторе
window.open("тут линк", "_blank", "toolbar=no, location=no, left="+l+", top= |
| << . 1 . 2 . 3 . 4 . >> |
|
Powered by miniBB forum software © 2001-2008
Powered by miniBB-gzipper. Original size:93950, gzipped size:24348 |