![]() ![]() |
20.10.2007, 17:18
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
выкладываем интересные скрипты [codebox] 1)Запрещяет браузерам говорить что произошла ошибка в java script: <!-- Запрет на JS ошибки --> <script LANGUAGE="JavaScript"> <!-- Begin function blockError(){return true;} window.onerror = blockError; // End --> </script> <!-- Запрет на JS ошибки -->[/code] 2 - Защищает страничку от копирования ( но как известно идеальной защиты нет) Код <script language="JavaScript1.2"> if (window.Event) document.captureEvents(Event.MOUSEUP); function nocontextmenu() { event.cancelBubble = true, event.returnValue = false; return false;//fantasyflash.ru } function norightclick(e) { if (window.Event) { if (e.which == 2 || e.which == 3) return false; } else if (event.button == 2 || event.button == 3) { event.cancelBubble = true, event.returnValue = false; return false; } } if (document.layers) document.captureEvents(Event.MOUSEDOWN); document.oncontextmenu = nocontextmenu;//osw document.onmousedown = norightclick; document.onmouseup = norightclick; //--></script> 3 - Делает страницу состоящую из нескольких вкладок [code]<html> <head> <script type="text/javascript"> //обьявление функции которая выполняет переключение между вкладками function showTab(pTabIndex) { var i=0; for (i=0; i<tabs.length; i++) { //делаем нужный контент-вкладку видимой. //стальное - невидимами tabs[i].style.display = (i == pTabIndex) ? "block" : "none"; //выделяем гиперссылку-корешок, соответствующую видимой вкладке,серым фоном , остальные - белым tabs[i].style.backgroundColor = (i == pTabIndex) ? "#cccccc" : "#ffffff"; } } </script> <!-- создаём стилевые классы для контейнеров ,содержащего гиперссылки-корешки вкладок , и для контейнера б содержащего сами вкладки --> <style> .tabhost { border: thin solid #cccccc; padding:5px; } .tabhs A { border: thin solid #cccccc; padding: 5px 5px 0px 5px; } </style> </head> <body> <div class="tabhs"> <A id="tabH1" href="#" ONCLICK="showTab(0);">вкладка 1 </A> <A id="tabH2" href="#" ONCLICK="showTab(1);">вкладка 2 </A> <A id="tabH3" href="#" ONCLICK="showTab(2);">вкладка 3 </A> </div> <div class="tabhost"> <div id="tab1"><p>это содержимое первой вкладкиp</p> </div> <div id="tab2"><p>это содержимое второй вкладкиp</p> </div> <div id="tab3"><p>это содержимое третей вкладки </p> <p>это содержимое </p> <p>это содержимое </p> <p>это содержимое </p> </div> </div> <script TYPE="text/javascript"> var tabs = new Array(); tabs[0] = document.all["tab1"]; tabs[1] = document.all["tab2"]; tabs[2] = document.all["tab3"]; var tabHs = new Array(); tabHs[0] = document.all["tabH1"]; tabHs[1] = document.all["tabH2"]; tabHs[2] = document.all["tabH3"]; //делаем изначально видимую первую вкладку showTab(0); </SCRIPT> </body> </html> Скрипт считает, сколько дней осталось до нового года. [codebox] <script language="JavaScript"><!-- today = new Date() nextyear = today.getYear() - -1 nextEVENT = new Date("January 1, " + nextyear) msPerDay = 24 * 60 * 60 * 1000; daysLeft = (nextEVENT.getTime() - today.getTime()) / msPerDay; daysLeft = Math.round(daysLeft); document.write("<CENTER><H3>До " + nextyear + " года осталось:<FONT COLOR=\"#FF0000\">" + daysLeft + " дней</FONT></H3></CENTER>") --></script> И не только. Можно сделать так, чтобы он считал, сколько дней осталось до дня рождения и т. п. . Например 9 мая: [codebox] <script language="JavaScript"><!-- today = new Date() nextyear = today.getYear() - -1 nextEVENT = new Date("May 9, " + nextyear) msPerDay = 24 * 60 * 60 * 1000; daysLeft = (nextEVENT.getTime() - today.getTime()) / msPerDay; daysLeft = Math.round(daysLeft); document.write("<CENTER><H3>До 9 мая осталось:<FONT COLOR=\"#FF0000\">" + daysLeft + " дней</FONT></H3></CENTER>") --></script> В строке [codebox] nextEVENT = new Date("May 9, " + nextyear) вместо May 9, пишем любую дату Список месяцев (кто не знает): January February March April May June July August September October November December -------------------- |
|
|
|
20.10.2007, 22:16
|
|
![]() Бывший админ ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 323 ICQ: 524558 12.7.2007 Санкт-Петербург 8 12 |
тема полезная, но что она делает в ява программировании?
-------------------- |
|
|
|
20.10.2007, 23:03
|
|
![]() :::ХЗ кто я:::: ![]() ![]() ![]() ![]() ![]() Специалисты 151 ICQ: 325266 17.9.2007 Беларусь, Витебск 433 6 |
Вот именно""!!!! А я в первом моём посте выкладывал учебники как делать именно java игры и приложения!!!
-------------------- |
|
|
|
20.10.2007, 23:17
|
|
![]() Бывший админ ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 323 ICQ: 524558 12.7.2007 Санкт-Петербург 8 12 |
Раздел для этой темы создан, тема перенесена
-------------------- |
|
|
|
21.10.2007, 8:51
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
Клевые часы следующие за курсором
CODE <html> <head> <title>Ishodniki.Ru - Scripts - JavaScript - Silly Clock 4</title> <META http-equiv="Content-Type" content="text/html; charset=windows-1251"> <Style> A:Link{ Color: #000000; Text-decoration: underline} A:Visited{ Color: #000000; Text-decoration: underline} A:Hover{ Color: #000000; Text-decoration: none} td, body {font-family: verdana, arial, helvetica; font-size:11px;} </Style> <!-- HEAD START HERE --> <script LANGUAGE="JavaScript"> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! --> <!-- Silly Clock 4 by Kurt Griggt --> <!-- --> <!-- Begin fCol='000000';//face colour. dCol='ff0000';//dot colour. hCol='ff0000';//hours colour. mCol='000000';//minutes colour. sCol='7788ff';//seconds colour. ClockHeight=35; ClockWidth=35; ClockFromMouseY=80; ClockFromMouseX=5; //Alter nothing below! Alignments will be lost! ns=(document.layers); ie=(document.all); h=3; m=4; s=5; face='1 2 3 4 5 6 7 8 9 10 11 12'; face=face.split(' '); n=face.length; speed=0.6; ymouse=0; xmouse=0; scrll=0; p="<font face=Arial size=1 color="+fCol+">"; e=360/n; HandHeight=ClockHeight/4; HandWidth=ClockWidth/4; HandY=0; HandX=0; scrll=0; y=new Array();x=new Array();Y=new Array();X=new Array(); for (i=0; i < 37; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0} Dy=new Array();Dx=new Array();DY=new Array();DX=new Array(); for (i=0; i < n; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0} if (ns){ for (i=0; i < n; i++) document.write('<layer name="nsN'+i+'" top=0 left=0 height=15 width=15><center>'+p+face[i]+'</font></center></layer>'); for (i=0; i < n; i++) document.write('<layer name="nsD'+i+'" top=0 left=0 bgcolor='+dCol+' clip="0,0,2,2"></layer>'); for (i=0; i < h; i++) document.write('<layer name=nsH'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>'); for (i=0; i < m; i++) document.write('<layer name=nsM'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>'); for (i=0; i < s; i++) document.write('<layer name=nsS'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>'); } if (ie){ document.write('<div id="On" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < n; i++) document.write('<div id="ieN" style="position:absolute;width:15px;height:15px;text-align:center">'+p+face[i]+'</font></div>'); document.write('</div></div>'); document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < n; i++) document.write('<div id="ieD" style="position:absolute;height:2px;width:2px;font-size:2px;background:'+dCol+'"></div>'); document.write('</div></div>'); document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < h; i++) document.write('<div id="ieH" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>'); document.write('</div></div>'); document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < m; i++) document.write('<div id="ieM" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>'); document.write('</div></div>') document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < s; i++) document.write('<div id="ieS" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>'); document.write('</div></div>') } (ns)?window.captureEvents(Event.MOUSEMOVE):0; function Mouse(evnt){ ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY; xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX; } (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse; function ClockAndAssign(){ time = new Date (); secs = time.getSeconds(); sec = -1.57 + Math.PI * secs/30; mins = time.getMinutes(); min = -1.57 + Math.PI * mins/30; hr = time.getHours(); hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360; if (ie){ On.style.top=window.document.body.scrollTop; Od.style.top=window.document.body.scrollTop; Oh.style.top=window.document.body.scrollTop; Om.style.top=window.document.body.scrollTop; Os.style.top=window.document.body.scrollTop; } for (i=0; i < s; i++){ var sd=(ns)?document.layers['nsS'+i]:ieS[i].style; sd.top=y[8+i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll; sd.left=x[8+i]+HandX+(i*HandWidth)*Math.cos(sec); } for (i=0; i < m; i++){ var md=(ns)?document.layers['nsM'+i]:ieM[i].style; md.top=y[4+i]+HandY+(i*HandHeight)*Math.sin(min)+scrll; md.left=x[4+i]+HandX+(i*HandWidth)*Math.cos(min); } for (i=0; i < h; i++){ var hd=(ns)?document.layers['nsH'+i]:ieH[i].style; hd.top=y[1+i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll; hd.left=x[1+i]+HandX+(i*HandWidth)*Math.cos(hrs); } for (i=0; i < n; i++){ var D=(ns)?document.layers['nsD'+i]:ieD[i].style; D.top=y[13+i] + ClockHeight*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll; D.left=x[13+i] + ClockWidth*Math.cos(-1.0471 + i*e*Math.PI/180); } for (i=0; i < n; i++){ var N=(ns)?document.layers['nsN'+i]:ieN[i].style; N.top=y[25+i]-6 + ClockHeight*1.4*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll; N.left=x[25+i]-6 + ClockWidth*1.4*Math.cos(-1.0471 + i*e*Math.PI/180); } } function Delay(){ scrll=(ns)?window.pageYOffset:0; y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed); x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed); for (i=1; i < 37; i++){ y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed); x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed); } ClockAndAssign(); setTimeout('Delay()',20); } if (ns||ie)window.onload=Delay; // End --> </script> <!-- HEAD END HERE --> </head> <body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0"> <center> <!-- BODY START HERE --> <!-- BODY END HERE --> </body> </html> Скрипт для автоматического добавления в избранное. CODE <html> <head> <title>Softoplanet.ru - Scripts - JavaScript - Favorites</title> <META http-equiv="Content-Type" content="text/html; charset=windows-1251"> <META NAME="description" CONTENT="Коллекции CGI, PHP, JavaScript скриптов, Java апплеты, огромное количество документации по разным языкам программирования, анимированные гифы, фоны, полезные программы, форум, ссылки по теме."> <META NAME="keywords" CONTENT="perl scripts, perl, cgi scripts, cgi, перл, java, java scripts, веб-программирование, web-programming, html, каталог ссылок, документация по веб-программированию, cgi скрипты, java скрипты, игры, java апплеты, апплеты, гифы, скрипты, скрипт, книги по веб-программированию, форум по perl, CGI, Perl, script, HTML"> <Style> A:Link{ Color: #000000; Text-decoration: underline} A:Visited{ Color: #000000; Text-decoration: underline} A:Hover{ Color: #000000; Text-decoration: none} td, body {font-family: verdana, arial, helvetica; font-size:11px;} </Style> <!-- HEAD START HERE --> <script Language="Javascript"> var bm_url="http://www.softoplanet.ru" var bm_titel="Softoplanet.ru - портал для веб-мастера" function bookmark() {if (document.all) window.external.AddFavorite(bm_url,bm_titel)} </Script> <!-- HEAD END HERE --> </head> <body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0" OnLoad="bookmark()"> <center> <!-- BODY START HERE --> Графические часы: Графические файлы dg0.gif ... dg9.gif содержат изображения цифр от 0 до 9, dgс.gif - двоеточие ( dgв.gif - точку (.), размер файлов 23 на 28 пикселей. CODE <html> <head> <meta content="text/html; charset=windows-1251" http-equiv="Content-Type"> <script> dig0 = new Image(); dig0.src = "dg0.gif"; dig1 = new Image(); dig1.src = "dg1.gif"; dig2 = new Image(); dig2.src = "dg2.gif"; dig3 = new Image(); dig3.src = "dg3.gif"; dig4 = new Image(); dig4.src = "dg4.gif"; dig5 = new Image(); dig5.src = "dg5.gif"; dig6 = new Image(); dig6.src = "dg6.gif"; dig7 = new Image(); dig7.src = "dg7.gif"; dig8 = new Image(); dig8.src = "dg8.gif"; dig9 = new Image(); dig9.src = "dg9.gif"; </script> <meta content="Microsoft FrontPage 3.0" name="GENERATOR"> <title>Design Gallery</title> </head> <body bgcolor="#FFFFFF"> <div align="center"><div align="center"><center> <table bgColor="#000000" border="1" cellSpacing="3" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bordercolor="#000000"> <TBODY> <tr> <td><img name="dg1" width="23" height="28"><img name="dg2" width="23" height="28"><img src="dgc.gif" width="23" height="28"><img name="dg3" width="23" height="28"><img name="dg4" width="23" height="28"><img src="dgp.gif" width="23" height="28"><img name="dg5" width="23" height="28"><img name="dg6" width="23" height="28"></td> </tr> </TBODY> </table> </center></div><script language="JavaScript"> function clockTick() { var text = "" var now = new Date() var secunde = now.getSeconds() var minute = now.getMinutes() var hour = now.getHours() hour = (hour == 0) ? 12 : hour if (minute < 10) minute = "0" + minute if (secunde < 10) secunde = "0" + secunde now = null minute += "" hour += "" secunde += "" setjpg(hour.charAt(0),document.dg1); setjpg(hour.charAt(1),document.dg2); setjpg(minute.charAt(0),document.dg3); setjpg(minute.charAt(1),document.dg4); setjpg(secunde.charAt(0),document.dg5); setjpg(secunde.charAt(1),document.dg6); setTimeout("clockTick()", 1000); } function setjpg(num,docobj) { if (num=="0") docobj.src=dig0.src if (num=="1") docobj.src=dig1.src if (num=="2") docobj.src=dig2.src if (num=="3") docobj.src=dig3.src if (num=="4") docobj.src=dig4.src if (num=="5") docobj.src=dig5.src if (num=="6") docobj.src=dig6.src if (num=="7") docobj.src=dig7.src if (num=="8") docobj.src=dig8.src if (num=="9") docobj.src=dig9.src } clockTick(); --> </script> </div> </body> </html> Тоже часы, только в текстовом поле CODE <form name=clock><input type=text size=30 name=full> <script language="JavaScript"><!-- function checktime() { var time=new Date(); document.clock.full.value=time.toLocaleString(); setTimeout(" checktime()",500) } checktime() //--></script> -------------------- |
|
|
|
21.10.2007, 9:09
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
Отображение рнисунка возле курсора.
Чтобы установить собственный рисунок изменяем строчку CODE T1=new Array("Http://www.mysite.ru/res/cursor_image.gif",ширина,высота) CODE <script language=javascript1.3><!-- B=document.all; C=document.layers; T1=new Array("victory.gif",28,23) nos=parseInt(T1.length/3) rate=50 ie5fix1=0; ie5fix2=0; for (i=0;i<nos;i++){ createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")} function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){ with (document){ write((!B) ? "<layer id='"+N+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+"; "); if(St){ if © write(" style='"); write(St+";' ") } else write((B)?"'":""); write((At)? At+">" : ">"); write((HT) ? HT : ""); if (!Op) closeContainer(N) } } function closeContainer(){ document.write((B)?"</div>":"</layer>") } function getXpos(N){ return (B) ? parseInt(B[N].style.left) : C[N].left } function getYpos(N){ return (B) ? parseInt(B[N].style.top) : C[N].top } function moveContainer(N,DX,DY){ c=(B) ? B[N].style :C[N];c.left=DX;c.top=DY } function cycle(){ //if (IE5) if (document.all&&window.print){ ie5fix1=document.body.scrollLeft; ie5fix2=document.body.scrollTop; } for (i=0;i<(nos-1);i++){ moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1))) } } function newPos(e){ moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2 ) } if(document.layers) document.captureEvents(Event.MOUSEMOVE) document.onmousemove=newPos setInterval("cycle()",rate) //--></script>[/code] Вот ещё: Определение браузера [code]<BR>Имя броузера: <script language="JavaScript"> document.write(navigator.appName);</script><BR> Версия броузера: <script language="JavaScript">document.write(navigator.appVersion);</script><BR> Кодовое название броузера: <script language="JavaScript"> document.write(navigator.appCodeName);</script><BR> Заголовок пользовательского агента: <script language="JavaScript">document.write(navigator.userAgent);</script><BR> Падающие снежинки (мож. кто и видел) CODE <script language=JavaScript> //Configure below to change URL path to the snow image //Рисунок var snowsrc="http://keryax.narod.ru/resource/images/snow.png" // Configure below to change number of snow to render //количество снежинок var no = 10; var ns4up = (document.layers) ? 1 : 0; // browser sniffer var ie4up = (document.all) ? 1 : 0; var ns6up = (document.getElementById&&!document.all) ? 1 : 0; var dx, xp, yp; // coordinate and position variables var am, stx, sty; // amplitude and step variables var i, doc_width = 800, doc_height = 600; if (ns4up||ns6up) { doc_width = self.innerWidth; doc_height = self.innerHeight; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); for (i = 0; i < no; ++ i) { dx[i] = 0; // set coordinate variables xp[i] = Math.random()*(doc_width-50); // set position variables yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; // set amplitude variables stx[i] = 0.5 + Math.random()/5; // set step variables sty[i] = 5 + Math.random()*8; // set step variables if (ns4up) { // set layers if (i == 0) { document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"><\/layer>"); } else { document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"><\/layer>"); } } else if (ie4up||ns6up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>"); } } } function snowNS() { // Netscape main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.8 + Math.random()/5; sty[i] = 5 + Math.random()*8; doc_width = self.innerWidth; doc_height = self.innerHeight; } dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); } setTimeout("snowNS()", 100); } function snowIE_NS6() { // IE and NS6 main animation function for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.4 + Math.random()/5; sty[i] = 5 + Math.random()*8; doc_width = ns6up?window.innerWidth : document.body.clientWidth; doc_height = ns6up?window.innerHeight : document.body.clientHeight; } dx[i] += stx[i]; if (ie4up){ document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); } else if (ns6up){ document.getElementById("dot"+i).style.top=yp[i]; document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]); } } setTimeout("snowIE_NS6()", 100); } if (ns4up) { snowNS(); } else if (ie4up||ns6up) { snowIE_NS6(); } </SCRIPT> -------------------- |
|
|
|
22.10.2007, 19:14
|
|
![]() Бывший админ ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 323 ICQ: 524558 12.7.2007 Санкт-Петербург 8 12 |
patriarch я понимаю, что всем хочется побольше постов, но теги [codebox*][/codebox*] никто не отменял :rtfm:
-------------------- |
|
|
|
22.10.2007, 23:48
|
|
![]() aka =ZirrrO= ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 199 ICQ: 1141468 8.7.2007 Г. Железнодорожный 7 4 |
снег прикольный,тока этот без текстуры вродь,я с текстурой юзал,прикольно было)))
-------------------- Любить-значит перестать сравнивать. Любовь как война-легко начать,тяжело закончить,невозможно забыть. Разлука ослабевает легкое увлечение,но усиливает большую страсть,подобно тому,как ветер гасит свечу,но раздувает пожар. Не ставь ТОЧКУ там,где сердце ставит ЗАПЯТУЮ...
|
|
|
|
23.10.2007, 13:53
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
patriarch я понимаю, что всем хочется побольше постов, но теги [codebox*][/codebox*] никто не отменял :rtfm: Sonic если я все это вмещу в один пост,это будет сложно читать...некоторые скрипты очень большие.а про теги [codebox*][/codebox*] я просто не знал... -------------------- |
|
|
|
27.2.2008, 21:27
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
Вот скрипт для приветствия посетителя и показа сколько раз он загрузил страницу пример:
Вы загружали эту страницу 1 раз(а). Приветствуем на нашем сайте! А вот код Код <html>
<head> <title>http://bjs.stsland.ru/ - База Ява Скриптов (bjs)</title> <META http-equiv="Content-Type" content="text/html; charset=windows-1251"> <Style> A:Link{ Color: #000000; Text-decoration: underline} A:Visited{ Color: #000000; Text-decoration: underline} A:Hover{ Color: #000000; Text-decoration: none} td, body {font-family: verdana, arial, helvetica; font-size:11px;} </Style> <!-- HEAD START HERE --> <script LANGUAGE="JavaScript"> <!-- Begin function getCookieVal (offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie (name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal (j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (2 < argc) ? argv[2] : null; var path = (3 < argc) ? argv[3] : null; var domain = (4 < argc) ? argv[4] : null; var secure = (5 < argc) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : ""); } function DisplayInfo() { var expdate = new Date(); var visit; expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); if(!(visit = GetCookie("visit"))) visit = 0; visit++; SetCookie("visit", visit, expdate, "/", null, false); var message; if(visit == 1) message="Приветствуем на нашем сайте!"; if(visit== 2) message="2 раза приветствуем!"; if(visit == 3) message="Бог любит троицу."; if(visit == 4) message="Привет Привет Привет"; if(visit == 5) message="Ну что понравился сайт?"; if(visit == 6) message="Так держать!"; if(visit == 7) message="Семь раз ты был на этой страничке"; if(visit == 8) message="Сообщение для восьмого визита"; if(visit == 9) message="Сообщение для девятого визита"; if(visit >= 10) message="Последнее постоянное сообщение!"; alert("\n"+"Вы загружали эту страницу \n" +" "+visit+"\n" +" раз(а)."+"\n"+"\n" +message); } function ResetCounts() { var expdate = new Date(); expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); visit = 0; SetCookie("visit", visit, expdate , "/", null, false); history.go(0); } // End --> </Script> <!-- HEAD END HERE --> </head> <body bgcolor="#EDEDED" text="#000000" link="#000000" topmargin="0" leftmargin="0" onload="DisplayInfo()"> <center> <!-- BODY START HERE --> <FORM> <CENTER> <INPUT NAME="update" TYPE="BUTTON" VALUE="Обновить" OnClick="history.go(0)"> <INPUT NAME="reset" TYPE="BUTTON" VALUE="Очистить" OnClick="ResetCounts()"> </CENTER> </FORM> <!-- BODY END HERE --> </center> </body> </html> -------------------- |
|
|
|
27.2.2008, 21:27
|
|
![]() Задумчивый Юноша ![]() ![]() ![]() ![]() ![]() ![]() ![]() Специалисты 302 1.10.2007 Новосиб 1 093 14 |
картинка со случайным числом от 1000 до 9999
Код <?php
/////////////////////////////////////////////////////////////////////////////// // Картинка для зашиты от авторагистрации // /////////////////////////////////////////////////////////////////////////////// $num = rand(1000, 9999); $im = @ImageCreate (90, 20) or die ('Cannot Initialize new GD image stream'); header ('Content-type: image/png'); $background_color = ImageColorAllocate ($im, 0xfc, 0xfc, 0xff); $text_color = ImageColorAllocate ($im, 10, 10, 10); $color1 = ImageColorAllocate ($im, 120, 15, 20); $color2 = ImageColorAllocate ($im, 13, 110, 0); for ($i=1; $i<6; $i++) { $idq = rand(1, 7); imageellipse($im, 0, 0, 30*$idq, 15*$idq, $text_color); } for ($i=1; $i<100; $i++) { $x = rand(1, 90); $y = rand(1, 19); imageline($im, $x, $y, $x, $y, $color1); } for ($i=1; $i<100; $i++) { $x = rand(1, 90); $y = rand(1, 19); imageline($im, $x, $y, $x, $y, $color2); } for ($i=1; $i<2; $i++){ imageline($im, 0, rand(1, 19), 90, rand(1, 19), $color1); } for ($i=1; $i<3; $i++){ imageline($im, rand(1, 90), 0, rand(1, 89), 90, $color2); } for($i=0;$i<strlen($num);$i++) { ImageString($im, 5, 8+13*$i+rand(-2,2), 3+rand(-2,2),$num[$i], $text_color); } ImagePng ($im); ?> -------------------- |
|
|
|
![]() ![]() |
|
Copyright All java (Вся ява) © 2007-2009 : 4.6.2026, 11:20 Копирование материалов не приветствуется. Для вопросов авторского права |
![]() |