ОсновноеRadiotalkПользовательское
MPCHAT - CMS хостинг чатов для профессионалов
83   •   Посмотреть все темы

JavaScript - Скрипты

 

37
BLack @BLack
часики
<script language="JavaScript">
<!--
function clockon() {
thistime = new Date()
var hours = thistime.getHours()
var minutes = thistime.getMinutes()
var seconds = thistime.getSeconds()
if (eval(hours) <10) {hours = "0" + hours}
if (eval(minutes) < 10) {minutes = "0" + minutes}
if (seconds < 10) {seconds = "0" + seconds}
thistime = hours + ":" + minutes + ":" + seconds
if (document.all) {
bgclocknoshade.innerHTML = thistime
bgclockshade.innerHTML = thistime
}
if (document.layers) {
document.bgclockshade.document.write ('<div id = "bgclockshade" style = " position:absolute; visibility:visible; font-family:Arial,sans-serif; color:#cccccc; font-size:30px; top:155px; left:152px">' +thistime+ '</div>')
document.bgclocknoshade.document.write ('<div id = "bgclocknoshade" style = "position:absolute; visibility:visible; font-family:Arial,sans-serif; color:#000000; font-size:30px; top:150px; left:150px">' +thistime+ '</div>')
document.close()
}
var timer=setTimeout ("clockon()", 200)
}
//-->
</script>

Отредактировано BLack - 30.06.2007
37
BLack @BLack
часы катаются за курсором :Р [b]
<script language="JavaScript">
dCol='ff0000';//цвет даты
fCol='0000ff';//лицевой цвет.
sCol='000000';//секунды
mCol='000000';//минуты
hCol='000000';//часы
ClockHeight=30;
ClockWidth=30;
ClockFromMouseY=0;
ClockFromMouseX=100;


d=new Array("Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота");
m=new Array("Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабр");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+d[date.getDay()]+" "+m[date.getMonth()]+" "+day+" "+year;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=1;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; 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 < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></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.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</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.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</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.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</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){
Od.style.top=window.document.body.scrollTop;
Of.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 < n; i++){
var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
}
for (i=0; i < H.length; i++){
var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < M.length; i++){
var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < S.length; i++){
var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < D.length; i++){
var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
}
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; 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;
</script>

Отредактировано BLack - 30.06.2007
37
BLack @BLack
часы в поле формы
<script language="JavaScript">
function fulltime() {
var time=new Date();
document.clock.full.value=time.toLocaleString();
setTimeout('fulltime()',500)
}
</script>
<body bgcolor=ffffff text=ff0000>
<center>
<form name=clock>
<input type=text size=45 name=full>
</form>
<script language="JavaScript">
fulltime();
</script>

Отредактировано BLack - 30.06.2007
37
BLack @BLack
таймер
<script language="JavaScript">
<!--
var Temp2;
var timerID = null;
var timerRunning = false;
function showtime() {
now = new Date();
var CurHour = now.getHours();
var CurMinute = now.getMinutes();
var CurMonth = now.getMonth();
var CurDate = now.getDate();
var CurYear = now.getYear();
var CurSecond = now.getSeconds();
now = null;
Hourleft1 = 23 - CurHour
var Hourleft = Math.abs( Hourleft1 )
Minuteleft1 = 59 - CurMinute
var Minuteleft = Math.abs( Minuteleft1 )
Secondleft1 = 59 - CurSecond
var Secondleft = Math.abs( Secondleft1 )
if (CurYear==101) {var Yearleft = 101 - CurYear} else {var Yearleft = 2006 - CurYear};
var Monthleft1 = 11 - CurMonth
var Monthleft = Math.abs( Monthleft1 )
var Dateleft1 = 31 - CurDate
var Dateleft = Math.abs( Dateleft1 )
if (Yearleft!=1) {var ys="s"} else {var ys=""};
if (Monthleft!=1) {var mos="s"} else {var mos=""}
if (Dateleft!=1) {var ds="s"} else {var ds=""}
if (Hourleft!=1) {var hs="s"} else {var hs=""}
if (Minuteleft!=1) {var mis="s"} else {var mis=""}
if (Secondleft!=1) {var ss="s"} else {var ss=""}
Temp2=Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+','+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss+' до Нового года!'
Temp3=Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss
window.status=Temp2;
document.frm.left.value=Temp3;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
var timerID = null;
var timerRunning = false;
function stopclock () {
if(timerRunning) clearTimeout(timerID);
timerRunning = false;
}
function startclock () {
stopclock();
showtime();
}
//-->
</script>

А этой формой осуществляется вывод данных.

<form name="frm">
<input type="textarea" name="left" size=50 value="С Новым годом!">
</form>

Отредактировано BLack - 30.06.2007
105
Human @Human
Астрологический калькулятор<meta http-equiv = "content-type" content = "text/html; charset = Windows-1251">
<SCRIPT LANGUAGE="JavaScript">
function signs() {
var start = 1901, birthyear = document.zodiac.year.value, date=document.zodiac.date.value, month=document.zodiac.month.selectedIndex;

with (document.zodiac.sign){

if (month == 1 && date >=20 || month == 2 && date <=18) {value = "Водолей";}
if (month == 1 && date > 31) {value = "Ошибка!";}
if (month == 2 && date >=19 || month == 3 && date <=20) {value = "Рыбы";}
if (month == 2 && date > 29) {value = "Ошибка!";}
if (month == 3 && date >=21 || month == 4 && date <=19) {value = "Овен";}
if (month == 3 && date > 31) {value = "Ошибка!";}
if (month == 4 && date >=20 || month == 5 && date <=20) {value = "Телец";}
if (month == 4 && date > 30) {value = "Ошибка!";}
if (month == 5 && date >=21 || month == 6 && date <=21) {value = "Близнецы";}
if (month == 5 && date > 31) {value = "Ошибка!";}
if (month == 6 && date >=22 || month == 7 && date <=22) {value = "Рак";}
if (month == 6 && date > 30) {value = "Ошибка!";}
if (month == 7 && date >=23 || month == 8 && date <=22) {value = "Лев";}
if (month == 7 && date > 31) {value = "Ошибка!";}
if (month == 8 && date >=23 || month == 9 && date <=22) {value = "Дева";}
if (month == 8 && date > 31) {value = "Ошибка!";}
if (month == 9 && date >=23 || month == 10 && date <=22) {value = "Весы";}
if (month == 9 && date > 30) {value = "Ошибка!";}
if (month == 10 && date >=23 || month == 11 && date <=21) {value = "Скорпион";}
if (month == 10 && date > 31) {value = "Ошибка!";}
if (month == 11 && date >=22 || month == 12 && date <=21) {value = "Стрелец";}
if (month == 11 && date > 30) {value = "Ошибка!";}
if (month == 12 && date >=22 || month == 1 && date <=19) {value = "Козерог";}
if (month == 12 && date > 31) {value = "Ошибка!";}
}
x = (start - birthyear) % 12
with (document.zodiac.csign){
if (x == 1 || x == -11) {value = "Крыса";}
if (x == 0) {value = "Бык";}
if (x == 11 || x == -1) {value = "Тигр";}
if (x == 10 || x == -2) {value = "Кролик";}
if (x == 9 || x == -3) {value = "Дракон";}
if (x == 8 || x == -4) {value ="Змея";}
if (x == 7 || x == -5) {value = "Лошадь";}
if (x == 6 || x == -6) {value = "Овца";}
if (x == 5 || x == -7) {value = "Обезьяна";}
if (x == 4 || x == -8) {value = "Петух";}
if (x == 3 || x == -9) {value = "Собака";}
if (x == 2 || x == -10) {value = "Кабан";}
}}
</script>

<form name="zodiac">
<center>
<table bgcolor="#60d4ff" border="2" bordercolor="#000000" rules="none" cellspacing="0" cellpadding="4">
<tr><td><b><i>Year</i></b></td>
<td><div align="right"><input type="text" size="10" name="year" value="Год" onClick=value=""></div></td>
<td>&nbsp;</td>
<tr><td><b><i>Месяц</i></b></td>
<td><div align="right">
<select name="month">
<option value="x">Месяц</option>
<option value="1">Январь</option>
<option value="2">Февраль</option>
<option value="3">Март</option>
<option value="4">Апрель</option>
<option value="5">Май</option>
<option value="6">Июнь</option>
<option value="7">Июль</option>
<option value="8">Август</option>
<option value="9">Сентябрь</option>
<option value="10">Октябрь</option>
<option value="11">Ноябрь</option>
<option value="12">Декабрь</option>
</select></div></td>
<td>&nbsp;</td></tr>
<tr><td><b><i>День</i></b></td>
<td><div align="right"><input type="text" name="date" value="День" size="3" onClick=value=""></td>
<td><input type="button" value="Расчет" onClick="signs()"></div></td></tr>
<tr><td><b><i>Знак Зодиака:</i></b></td>
<td><div align="right"><input type="text" name="sign" size="12" value="" align="right"></div</td></tr>
<td>&nbsp;</td></tr>
<tr><td><b><i>Восточный календарь:</i></b></td>
<td><div align="right"><input type="text" name="csign" size="12"></div></td>
<td>&nbsp;</td></tr>
</table>
</center>
</form>

105
Human @Human
Загрузка страницы
<html>
<head>
<title>WOscripts.com - JavaScript - LoadingBar</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">


<!-- HEAD START HERE -->

<style type="text/css">
#divLoadCont {position:absolute; z-index:500; left:0px; top:0px; width:100%; height:98%; clip:rect(0px 100% 100% 0px); background-color:#ffffff; layer-background-color:#ffffff;}
#divLoad1 {position:absolute; layer-background-color:silver; background-color:silver;}
#divLoad2 {position:absolute; left:0px; top:0px; layer-background-color:navy; background-color:navy;}
#divLoadText {position:absolute; background-color:transparent; font-family:arial,helvetica,sans-serif; color:navy; font-size:14px;}
</style>
<script language="JavaScript" type="text/javascript">
/**********************************************************************************
LoadingBar
* Copyright (C) 2001 Thomas Brattli
* This script was released at WOscripts.com
* Visit for more great scripts!
* This may be used and changed freely as long as this msg is intact!
* We will also appreciate any links you could give us.
*********************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
return this
}
var bw=new lib_bwcheck()



/*VARIABLES TO SET START: */
numImages = 10 //How many images you have in your page
loaderWidth = 300 //The width of the loadbar
/*
All other settings, like colors fonts and stuff like that you
have to change in the STYLE section.

IMPORTANT:
To make this actually show the correct results
you have to place THIS code in all images:
onload="loadIt(1)"

Which means that your image should look
something like this:
<img src="whatever.gif" width="10" border="0" height="10" onload="loadIt(1)">


VARIABLES TO SET END: */



// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

currentImg = 0
//Document size object ********
function lib_doc_size(){
this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
if(!this.x2||!this.y2) return message('Document has no width or height')
this.x50=this.x2/2;this.y50=this.y2/2;
return this;
}

//Lib objects ********************
function lib_obj(obj,nest){
nest=(!nest) ? "":'document.'+nest+'.'
this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;
this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt;
this.ref=this.css
this.w=this.evnt.offsetWidth||this.css.clip.width||
this.ref.width||this.css.pixelWidth||0;
return this
}
//Moving object to **************
lib_obj.prototype.moveIt = function(x,y){
this.x=x; this.y=y; this.css.left=x+px; this.css.top=y+px;
}
//Clipping object to ******
lib_obj.prototype.clipTo = function(t,r,b,l,setwidth){
this.ct=t; this.cr=r; this.cb=b; this.cl=l
if(bw.ns4){
this.css.clip.top=t;this.css.clip.right=r
this.css.clip.bottom=b;this.css.clip.left=l
}else{
if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";
if (setwidth){
this.css.pixelWidth = r;
this.css.pixelHeight = b;
this.css.width = r+px;
this.css.height = b+px;
}
}
}
var oLoad2
function startLoading(){
page = new lib_doc_size()
oLoadCont = new lib_obj('divLoadCont')
oLoad = new lib_obj('divLoad1','divLoadCont')
oLoad2 = new lib_obj('divLoad2','divLoadCont.document.divLoad1')
oLoadText = new lib_obj('divLoadText','divLoadCont.document.divLoad1')
oLoad.moveIt(page.x50-loaderWidth/2,page.y50-20)
oLoadText.moveIt(loaderWidth/2 - oLoadText.w/2,10)
oLoad.clipTo(0,loaderWidth,40,0,1)
oLoad2.per = loaderWidth/numImages
}
function loadIt(ok){
currentImg ++
if (oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
if (!ok){
oLoadCont.css.visibility = "hidden"
oLoadCont = null;
oLoad1 = null;
oLoad2 = null;
}
}

//DISPLAY FUNCTION - DELETE START -------- DELETE THIS *************
//LEAVE THIS FUNCTION WHILE TESTING. DELETE WHEN READY
function loadIt_display(ok){
currentImg ++
if (oLoad2) oLoad2.clipTo(0,oLoad2.per*currentImg,40,0,1)
if (currentImg<=numImages) setTimeout("loadIt_display(1)",200)
else{
oLoadCont.css.visibility = "hidden"
}
}
//DISPLAY FUNCTION - DELETE END *************************************
</script>

<!-- HEAD END HERE -->




</head>
<body bgcolor="#737994" text="#FFFFFF" link="#FFFFFF" topmargin="0" leftmargin="0">



<!-- BODY START HERE -->


<!-- ALWAYS HAVE THIS RIGHT AFTER THE BODY START TAG -->
<div id="divLoadCont">
<div id="divLoad1">
<div id="divLoad2"></div><br>
<div id="divLoadText">Загрузка...</div>
</div>
</div>
<script>
startLoading()
//onload=loadIt; //- LEAVE THIS LINE WHILE TESTING. UNCOMMENT WHEN READY
loadIt_display(1) //LEAVE THIS LINE WHILE TESTING. DELETE WHEN READY
</script>


<!-- BODY END HERE -->

<br><br><br>
<center>
SOFTPURGEN
<br><br>
</center>




</body>
</html>

105
Human @Human
Меню сбоку <HTML>

<body bgcolor="#FFFFFF" marginwidth="0" marginheight="0">


<!--***** Paste the following two lines directly below the body tag ************************-->
<script language="JavaScript1.2" src="sample1_data.js"></script>
<script language="JavaScript1.2" src="cs_script.js"></script>


<br>
<br>


<!--***** Position your image map and rollovers by pasting the following line anywhere within your HTML page **-->
<script language="JavaScript1.2" src="cs_map.js"></script>

<!--***** Position your content area by pasting the following line anywhere within your HTML page **-->
<script language="JavaScript1.2" src="cs_content.js"></script>


</body>
</HTML>

105
Human @Human
Навигация при помощи клавиатуры










Данный скрипт реализует навигацию посредством клавиш (надписи выделенные зеленым необходимо откорректировать).

<script language="JavaScript">
<!--
var key = new Array();
key['a'] = "index.htm";
key['b'] = "index1.htm";
key['c'] = "index2.htm";
key['d'] = "index3.htm";
function getKey(keyStroke) {
isNetscape=(document.layers);
eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
which = String.fromCharCode(eventChooser).toLowerCase();
for (var i in key) if (which == i) window.location = key[i];}
document.onkeypress = getKey;
//-->
</script>

.
Нажмите z для перехода на предыдущую страницу.
Нажмите x для перехода на следущую страницу.
Нажмите s для перехода на содержание.

105
Human @Human
3D Надпись

<head>
<script>
<!--

// Edit your messages. You MUST use 6 messages precisly.
var message = new Array()
message[0]=" >> Надпись 1"
message[1]=" >> Надпись 2"
message[2]=" >> Надпись 3"
message[3]=" >> Надпись 4"
message[4]=" >> Они вращаються!"
message[5]=" >> 6 надписей"
// Edit the width an height of your TextWheel (pixels)
var scrollerheight=120
var scrollerwidth=360

// Edit the font
var font_family="Verdana"

// Edit the font-size
var font_size=20

// Edit the horizontal and vertical position of your TextWheel (pixels)
var x_textposition=10
var y_textposition=10

function initiate() {
if (document.all) {
document.all.rotationstyle1.style.posLeft=x_textposition
document.all.rotationstyle1.style.posTop=y_textposition

document.all.rotationstyle2.style.posLeft=x_textposition
document.all.rotationstyle2.style.posTop=y_textposition

document.all.rotationstyle3.style.posLeft=x_textposition
document.all.rotationstyle3.style.posTop=y_textposition

document.all.rotationstyle4.style.posLeft=x_textposition
document.all.rotationstyle4.style.posTop=y_textposition

document.all.rotationstyle5.style.posLeft=x_textposition
document.all.rotationstyle5.style.posTop=y_textposition

document.all.rotationstyle6.style.posLeft=x_textposition
document.all.rotationstyle6.style.posTop=y_textposition

setmessages()
}
}

function setmessages() {

rotationstyle1.innerHTML=
'<OBJECT ID="rotationobj1" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[0]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationstyle2.innerHTML=
'<OBJECT ID="rotationobj2" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[1]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationstyle3.innerHTML=
'<OBJECT ID="rotationobj3" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[2]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationstyle4.innerHTML=
'<OBJECT ID="rotationobj4" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[3]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationstyle5.innerHTML=
'<OBJECT ID="rotationobj5" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[4]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationstyle6.innerHTML=
'<OBJECT ID="rotationobj6" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6" STYLE="position:relative;width:'+scrollerwidth+'px;height:'+2*scrollerheight+'px">'+
'<PARAM NAME="Line0001" VALUE="SetLineStyle(0)">'+
'<PARAM NAME="Line0002" VALUE="SetLineColor(0,0,0)">'+
'<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,0)">'+
'<PARAM NAME="Line0004" VALUE="SetFont(\''+font_family+'\', '+font_size+', 400, 0, 0, 0)">'+
'<PARAM NAME="Line0005" VALUE="Text(\''+message[5]+'\',0, 2, 0)">'+
'</OBJECT>'

rotationobj1.Rotate(0,0,0)
rotationobj2.Rotate(0,60,0)
rotationobj3.Rotate(0,120,0)
rotationobj4.Rotate(0,180,0)
rotationobj5.Rotate(0,240,0)
rotationobj6.Rotate(0,300,0)

startscroll()
}

function startscroll() {
rotationobj1.Rotate(1,2,0)
rotationobj2.Rotate(1,2,0)
rotationobj3.Rotate(1,2,0)
rotationobj4.Rotate(1,2,0)
rotationobj5.Rotate(1,2,0)
rotationobj6.Rotate(1,2,0)
timer=setTimeout("startscroll()",20)
}


// - End of JavaScript - -->
</script>

</head>


<body bgcolor = "Blue" onLoad="initiate()">


<SPAN ID="rotationstyle1" STYLE="position:absolute">
<OBJECT ID="rotationobj1" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<SPAN ID="rotationstyle2" STYLE="position:absolute">
<OBJECT ID="rotationobj2" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<SPAN ID="rotationstyle3" STYLE="position:absolute">
<OBJECT ID="rotationobj3" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<SPAN ID="rotationstyle4" STYLE="position:absolute">
<OBJECT ID="rotationobj4" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<SPAN ID="rotationstyle5" STYLE="position:absolute">
<OBJECT ID="rotationobj5" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<SPAN ID="rotationstyle6" STYLE="position:absolute">
<OBJECT ID="rotationobj6" CLASSID="CLSID:369303C2-D7AC-11d0-89D5-00A0C90833E6">
</OBJECT>
</SPAN>

<DIV id="Belongs_not_to_the_script" style="position:absolute;top:200px;left:5px;">

</DIV>

</body>

105
Human @Human
Подсказка в стиле Windows

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<style ID="AsstStyle">
BODY{font: messagebox;}
TD{font: messagebox;}
.clickable {color:darkblue; cursor:hand}
</style>
<title>Подсказка в стиле Windows</title>
</head>

<body topmargin="4px" leftmargin="4px" SCROLL="yes">
<table border="0" width="80%" cellpadding=0 cellspacing=0>
<tr>
<td ID=TipCell align="left" rowspan="2" width="34" valign="middle">
<img ID=TipGif src="tips.gif" width="27" height="36" alt="tips.gif (1045 bytes)"> </td>
<td ID=TipText width="90%" align="left"><strong>Знаете ли вы, что...</strong></td>
<td ID="GoNext" align="right" width="66" rowspan="2" nowrap>
<a href="javascript:goNext()" class="clickable" onmouseover="this.style.color='red'" onmouseout="this.style.color='darkblue'">Следующий совет</a>
</tr>
<tr>
<td width="90%" align="left">
<div ID="Tip0" Style="display:none;">
Чтобы увеличить или уменьшить текст веб-страниц, в меню <b>Вид</b> выберите пункт <b>Размер шрифта</b>. Нажмите клавишу F5, чтобы обновить экран.</div>
<div ID="Tip1" Style="display:none;">
Чтобы быстро сохранить веб-страницу в списке избранного, нажмите CTRL+D.</div>
<div ID="Tip2" Style="display:none;">
Можно отправить веб-страницу по электронной почте, в меню <b>Файл</b> указав пункт <b>Отправить</b>, а затем выбрав пункт <b>Страницу по электронной почте</b>.</div>
<div ID="Tip3" Style="display:none;">
Из рисунков и фона веб получаются отличные фоновые рисунки для рабочего стола. Просто щелкните правой кнопкой мыши на нужном рисунке и выберите <b>Сделать рисунком рабочего стола</b>.</div>
<div ID="Tip4" Style="display:none;">
Для прокрутки документа к началу нажмите клавишу со стрелкой вверх.</div>
<div ID="Tip5" Style="display:none;">
Для прокрутки большого документа к началу нажмите клавишу PAGE UP.</div>
<div ID="Tip6" Style="display:none;">
Чтобы быстро вернуться к предыдущим страницам, можно щелкнуть маленькую стрелку вниз справа от кнопки <b>Назад</b>.</div>
<div ID="Tip7" Style="display:none;">
Чтобы задать объем места на диске, занимаемого временными файлами Интернета, в меню <b>Сервис</b> выберите пункт <b>Свойства обозревателя</b>, а затем выберите <b>Настройка</b>.</div>
<div ID="Tip8" Style="display:none;">
Можно убедиться, что просматриваемая веб-страница содержит самую свежую информацию, нажав клавишу F5, чтобы обновить ее.</div>
<div ID="Tip9" Style="display:none;">
Internet Explorer помогает экономить время и усилия, заканчивая ввод часто вводимых адресов URL.</div>
<div ID="Tip10" Style="display:none;">
Чтобы перейти на один кадр вперед, нажмите клавиши CTRL+TAB.</div>
<div ID="Tip11" Style="display:none;">
Чтобы перейти на один кадр назад, нажмите клавиши SHIFT+CTRL+TAB.</div>
<div ID="Tip12" Style="display:none;">
Можно ввести слово в адресной строке и нажать клавиши CTRL+ENTER, чтобы автоматически добавить ********** и .com с любой стороны от введенного слова.</div>
<div ID="Tip13" Style="display:none;">
Если в качестве программы электронной почты используется Microsoft Outlook или Outlook Express, можно перетащить ярлык Интернета в сообщение электронной почты.</div>
<div ID="Tip14" Style="display:none;">
Можно перестроить список избранного или меню с помощью перетаскивания.</div>
<div ID="Tip15" Style="display:none;">
Чтобы напечатать текущую страницу или активный кадр, нажмите CTRL+P.</div>
<div ID="Tip16" Style="display:none;">
Чтобы узнать, какие действия можно выполнить с избранной ссылкой, щелкните правой кнопкой мыши ссылку в меню "Избранное".</div>
<div ID="Tip17" Style="display:none;">
Чтобы напечатать документ, можно перетащить ярлык Интернета на значок принтера на рабочем столе.</div>
<div ID="Tip18" Style="display:none;">
Можно обеспечить вызов наиболее часто посещаемых веб-страниц одним щелчком мыши, перетащив ярлык этих страниц на панель ссылок.</div>
<div ID="Tip19" Style="display:none;">
Для прокрутки к концу документа нажмите клавишу со стрелкой вниз.</div>
</td></tr>
</table>
<p><br class="userData" id="myData">
<script LANGUAGE="JavaScript" FOR="window" EVENT="onload">
Load();
</script><script>
var i=0;
var nTips=20;
function Load() {
var d = new Date();
i = ((d.getMonth() * 31) + d.getDate()) %nTips;
if (i==null) i=0;
eval("document.all.Tip"+i+".style.display=''");
}
function goNext()
{
eval("document.all.Tip"+i+".style.display='none'");
i=(((i%nTips)+1)%nTips);
eval("document.all.Tip"+i+".style.display=''");
}
</script>

105
Human @Human
Поиск на 16 поисковых системах<FORM action=http://adclick.ru/search.php method=post
target=new>
<TABLE id=table1 cellPadding=0 border=0>
<TBODY>
<TR>
<TD colSpan=3><INPUT size=25 name=text></TD></TR>
<TR>
<TD vAlign=top><SELECT size=1 name=search> <OPTION
value=3 selected>Rambler</OPTION> <OPTION
value=4>Yandex</OPTION> <OPTION
value=7>Fair.ru</OPTION> <OPTION
value=1>Google</OPTION> <OPTION value=9>Lupa</OPTION>
<OPTION value=10>Km</OPTION> <OPTION
value=2>Altavista</OPTION> <OPTION
value=5>Lycos</OPTION> <OPTION value=6>Aport</OPTION>
<OPTION value=8>Refer</OPTION> <OPTION
value=12>Yahoo</OPTION> <OPTION value=13>MSN</OPTION>
<OPTION value=14>Excite</OPTION> <OPTION
value=15>Alltheweb</OPTION> <OPTION
value=16>WebCrawler</OPTION> <OPTION value=17>AOL
NetFind</OPTION></SELECT></TD>
<TD vAlign=top><INPUT style="FONT-SIZE: 9pt" type=submit value=Поиск name=submit></TD>
<TD vAlign=center
align=right>&nbsp;</TD></TR></TBODY></TABLE></FORM>

105
Human @Human
Перемещающиеся слова, одно скользит горизонтально, два другие скользят и постояно находятся в противофазах, одно опускается другое поднимается
<script language="JavaScript">
<!--
var rad = 50;
var xoff = 170;
var yoff = 180;
var pi = Math.PI;
var inc = pi / 36;
var pos=0;
var xinc=3
function move() {
pos += inc;
xoff+=xinc;
if (xoff>=580) {xinc=-3}
if (xoff<=170) {xinc=3}
obj1.left = xoff+4;
obj1.top = (rad* Math.sin(pos)) + yoff;
obj2.left = xoff+27;
obj2.top = -(rad * Math.sin(pos)) + yoff;
obj3.left = xoff;
obj3.top = yoff;
setTimeout("move()", 30);
}
-->
</script>
</head>
<body>
<div id="obj2" style="z-index:8;position:absolute; width:70px; height:31px"><font face="Arial" size="3" color="#DC5912"><b>Сборник</b></font></div>
<div id="obj1" style="z-index:4;position:absolute;width:70px; height:31px"><font face="Arial" size="3" color="#9B4E00"><b>WWW.SOFTPURGEN.NAROD.RU</b></font></div>
<div id="obj3" style="z-index:6;position:absolute;width:89px; height:18px;clip:rect(0px 89px 18px 0px); background-color:#800000; layer-background-color:#8000FF;"><font face="Arial" size="3" color="Yellow"><b><center>JavaScripts</center></b></font></div>
<script language="JavaScript">
<!--
var NN = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var obj1 = (NN) ? document.obj1 : document.all.obj1.style;
var obj2 = (NN) ? document.obj2 : document.all.obj2.style;
var obj3 = (NN) ? document.obj3 : document.all.obj3.style;
move();
-->
</script>

105
Human @Human
Российские и мировые новости
Данный скрипт размещает на Вашем сайте последние российские и мировый новости. При этом посетители Вашего ресурса никуда не уходят по ссылкам заголовков новостей. Все новости загружаются в новое окно.
Для того, что бы на Вашем сайте всегда были последние новости, просто всавьте в HTML-код своей страницы следующие строки:
----------------------------------------

[color=blue]<script language="JavaScript" src="http://www.tezis.ru/news/tezis_news.js">
</script>
<script>
<!-- tezis_news(10); //-->
</script>[/color]

Во фрагменте "tezis_news(10)" приведенного кода в скобках указано количество выводимых новостей. Можете установить значение этого параметра от 1 до 10.

Для того что бы страницы с новостями не кэшировались браузером вставьте в заголовок страницы следующие строки:

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">

105
Human @Human
Cалют при наведении на ссылку
<html>
<head>
<title>Салют при наведении на ссылку</title>
<script>
<!--
var debrisnumber=40
var debriscolor=new Array()
debriscolor[0]="FFAAAA"
debriscolor[1]="AA0000"
debriscolor[2]="770000"
debriscolor[3]="AA4444"
debriscolor[4]="EE4422"
var x_debrispos
var y_debrispos
var x,y
var x_random=new Array()
var y_random=new Array()
var max_explsteps=20
var i_explsteps=0
var i_color=0
var pause=10

function checkbrowser() {
i_explsteps=0
x_debrispos=x
y_debrispos=y
for (i=0;i<=debrisnumber;i++) {
x_random[i]=Math.ceil(40*Math.random())-20
y_random[i]=Math.ceil(40*Math.random())-20
}
if (document.all) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.visibility="VISIBLE"
thisspan.posLeft=x_debrispos
thisspan.posTop=y_debrispos
}
explode_IE()
}
if (document.layers) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.visibility="VISIBLE"
thisspan.left=x_debrispos
thisspan.top=y_debrispos }
explode_NN()
} }

function explode_IE() {
if (i_explsteps<=max_explsteps) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft+=x_random[i]
thisspan.posTop+=y_random[i]
}
i_explsteps++
var timer=setTimeout("explode_IE()",pause)
}
else {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.visibility="HIDDEN"
}
clearTimeout(timer)
}
}
function explode_NN() {
if (i_explsteps<=max_explsteps) {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.left+=x_random[i]
thisspan.top+=y_random[i]
}
i_explsteps++
var timer=setTimeout("explode_NN()",pause)
}
else {
for (i=0;i<=debrisnumber;i++) {
var thisspan=eval("document.span"+i)
thisspan.visibility="HIDDEN"
}
clearTimeout(timer)
}
}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
// - End of JavaScript - -->
</script>
<style>
.spanstyle { position:absolute; visibility:hidden;}
</style>
</head>
<body>
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=debrisnumber;i++) {
document.write("<div id='span"+i+"' class='spanstyle'>")
document.write("<table cellpadding=0 cellspacing=0>")
document.write("<tr><td bgcolor="+debriscolor[i_color]+">")
document.write("<img src='emptypixel236.gif' width=3>")
document.write("</td></tr></table>")
document.write("</div>")
i_color++
if (i_color>=debriscolor.length) {i_color=0}
}
// - End of JavaScript - -->
</script>
<DIV id="redir" style="position:absolute; top:10px;
left:5px; visibility:visible;">
<div align="center"><a href="http://scriptic.ru"
onMouseOver="checkbrowser()"> Подведите мышь к ссылке</a></div>
</DIV>
</body>
</html>

105
Human @Human
Сделать страницу стартовой
title>JavaScript. Установление страницы стартовой</title>
</head>
<body>
<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.mpchat.ru/'); return false;">Сделать стартовой</a>

105
Human @Human
Сообщение в зависимости от дня недели
<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
</head>
<body>
<B><FONT SIZE=4><CENTER>
<Script Language="JavaScript">
now = new Date()
if (now.getDay() == 0)
document.write("Отдыхайте, завтра рабочий день...")
if (now.getDay() == 1)
document.write("Сегодня понедельник - настраивайтесь на работу")
if (now.getDay() == 2)
document.write("Уже вторник, понедельник к счастью позади!")
if (now.getDay() == 3)
document.write("Половина недели позади - сегодня уже среда")
if (now.getDay() == 4)
document.write("Сегодня четверг, скоро выходные...")
if (now.getDay() == 5)
document.write("Сегодня пятница - последний рабочий день")
if (now.getDay() == 6)
document.write("Сегодня первый день выходных!")
</Script>
</B></FONT>
</body>
</html>

105
Human @Human
Текст РАДУГА<b>
<font size="5">
<script>
var text="Сборник JavaScripts"
var speed=80

if (document.all||document.getElementById){
document.write('<span id="highlight">' + text + '</span>')
var storetext=document.getElementById? document.getElementById("highlight") : document.all.highlight
}
else
document.write(text)
var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
var r=1
var g=1
var b=1
var seq=1
function changetext(){
rainbow="#"+hex[r]+hex[g]+hex[b]
storetext.style.color=rainbow
}
function change(){
if (seq==6){
b--
if (b==0)
seq=1
}
if (seq==5){
r++
if (r==12)
seq=6
}
if (seq==4){
g--
if (g==0)
seq=5
}
if (seq==3){
b++
if (b==12)
seq=4
}
if (seq==2){
r--
if (r==0)
seq=3
}
if (seq==1){
g++
if (g==12)
seq=2
}
changetext()
}
function starteffect(){
if (document.all||document.getElementById)
flash=setInterval("change()",speed)
}
starteffect()
</script>

105
Human @Human
Текст увеличивается и уменьшается<script language="JavaScript">
<!-- Begin
// Original: Charles Foster (wcms_sf@msn.com)
// Web Site: **********

// This script and many more are available free online at
// The JavaScript Source!! **********


var speed = 100;
var cycledelay = 2000;
var maxsize = 28;

var x = 0;
var y = 0;
var themessage, size;
var esize = "</font>";

function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
var themessage2 = new initArray(
"Сборник JavaScripts",
"Можете скачать на www.mpchat.ru",
"Сборник разработал Human"
);
if(navigator.appName == "Netscape")
document.write('<layer id="wds"></layer><br>');
if (navigator.appVersion.indexOf("MSIE") != -1)
document.write('<span id="wds"></span><br>');
function upwords(){
themessage = themessage2[y];
if (x < maxsize) {
x++;
setTimeout("upwords()",speed);
}
else setTimeout("downwords()",cycledelay);

if(navigator.appName == "Netscape") {
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
wds.innerHTML = "<center>"+themessage+"</center>";
wds.style.fontSize=x+'px';
}
}
function downwords(){
if (x > 1) {
x--;
setTimeout("downwords()",speed);
}
else {
setTimeout("upwords()",cycledelay);
y++;
if (y > themessage2.length - 1) y = 0;
}
if(navigator.appName == "Netscape") {
size = "<font point-size='"+x+"pt'>";
document.wds.document.write(size+"<center>"+themessage+"</center>"+esize);
document.wds.document.close();
}
if (navigator.appVersion.indexOf("MSIE") != -1){
wds.innerHTML = "<center>"+themessage+"</center>";
wds.style.fontSize=x+'px';
}
}
setTimeout("upwords()",speed);
// End -->
</script>

105
Human @Human
Текст из одного цвета переливается в другой<script language=javascript>
var message="Сборник JavaScripts на WWW.MPCHAT.RU"
var neonbasecolor="#000000" //Начальный цвет
var neontextcolor="#ff0000" //Конечный цвет
var flashspeed=20 //Скорость, чем больше - тем медленнее
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>')
var tempref=document.all.neonlight
}
else
document.write(message)
function neon(){
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}
tempref[n].style.color=neontextcolor
if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout("beginneon()",3000)
return
}
}
function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>

Отредактировано Human - 09.10.2007
105
Human @Human
Уничтожитель фреймов
Этот скрипт предназначен для страниц с фрэймами. Представьте себе такую картину: странник сети долго искал в поисковых машинах нужную ему информацию и попал на одну из ваших страниц которая должна быть во фрейме. Он посмотрит эту страницу и нажмет кнопку «Back» и навсегда забудет о вашем сайте. Так вот, этот скрипт предназначен для того, чтобы пользователь не ушел бесследно, а зашел на главную страницу сайта и увидел что на нем еще есть. Скрипт при открытии страницы на которой он размещен на весь экран выдаст текст (надписи выделенные зеленым необходимо откорректировать).


<script language="JavaScript">
<!--
if (self.parent.frames.length == 0)
document.writeln("Лучше смотреть с <a href=\"index.htm\">управлющим фреймом</a>");
//-->
</script>

А этот скрипт прямо пересылает на заглавную страницу без всяких вопросов.

<script language="JavaScript">
<!--
if (self.parent.frames.length == 0)
self.parent.location="index.htm";
//-->
</script>