Форум поддержки Gund.ru Подписаться на новости форума
Писать могут вошедшие с аккаунтом old-web.com. Войти Регистрация

Сообщения пользователя LupusNox

« Назад в профиль

Самые Часто Используемые Скрипты 20.05.2008 21:51
Скрипт Падающие звёзды
Цитата:
<SCRIPT language=JavaScript1.2>
var no = 30;
var speed = 6;
var snowflake = "http://svweb.narod.ru/image/zv6.gif";

var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var am, stx, sty;
var i, doc_width = 1024, doc_height = 768;
if (ns4up) {
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 = 1; i < no; ++ i) { 
dx[i] = 1;         
xp[i] = Math.random()*(doc_width-5);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*6;         
stx[i] = 0.05 + Math.random()/30;
sty[i] = 0.7 + Math.random();   
if (ns4up) {                 
if (i == 1) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\"");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
   }
} else if (ie4up) {
if (i == 1) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
      }
   }
}
function snowNS() {
for (i = 1; i < no; ++ i) { 
yp[i] += sty[i];
if (yp[i] > doc_height-5) {
xp[i] = Math.random()*(doc_width-am[i]-5);
yp[i] = 1;
stx[i] = 0.05 + Math.random()/30;
sty[i] = 0.7 + Math.random();
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()", speed);
}
function snowIE() {
for (i = 1; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-5) {
xp[i] = Math.random()*(doc_width-am[i]-5);
yp[i] = 1;
stx[i] = 0.05 + Math.random()/30;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</SCRIPT>
Самые Часто Используемые Скрипты 20.05.2008 21:50
Скрипт Падающие листья
Код:
<SCRIPT language=JavaScript1.2>
var no = 12;//добавьте колличество листиков 
var speed = 5;//измените скорость падения листьев 
var snowflake = "http://svweb.narod.ru/image/list2.gif";//укажите путь к папке с листьями

var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; 
var am, stx, sty; 
var i, doc_width = 1024, doc_height = 768;
if (ns4up) {
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;         
xp[i] = Math.random()*(doc_width-50); 
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;        
stx[i] = 0.02 + Math.random()/20; 
sty[i] = 0.7 + Math.random();   
if (ns4up) {                  
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() { 
for (i = 0; i < no; ++ i) {  
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-20);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/30;
sty[i] = 0.7 + Math.random();
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()", speed);
}
function snowIE() { 
for (i = 0; i < no; ++ i) { 
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-20);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/30;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</SCRIPT>
Самые Часто Используемые Скрипты 20.05.2008 21:38
Скрипт выдачи случайных ссылок.
Цитата:
<html>
<head>
<title>Скрипт выдачи случайных ссылок.</title>
<SCRIPT language="JavaScript">
<!-- This script and many more are available free online at -->
<!-- Begin
function go_to(url) {
window.location=url;
}
function rand_link() {
var a;
a = 1+Math.round(Math.random()*4);   // a = random number between 1-4
if (a==1) go_to("http://script.ru/index.shtml");
if (a==2) go_to("http://yndex.ru/");
if (a==3) go_to("http://rambler.ru/");
if (a==4) go_to("http://studia.script.ru/");
}
// End -->
</SCRIPT>
</head>
<body>
<CENTER>
<FORM NAME="myForm">
<INPUT TYPE="button" NAME="myButton" VALUE="Случайная ссылка"
onClick="rand_link()">
</FORM>
</CENTER>
</body>
</html>
Дизайн Scriptic
Самые Часто Используемые Скрипты 20.05.2008 21:37
Ссылки показываются все на одном месте, меняются с красивым эффектом.
Цитата:
<html>
<head>
<title>Ссылки показываются все на одном месте, меняются с красивым эффектом.</title>
</head>
<body onLoad="begin()">
<script>
<!--
function correct(){
if (finished){
setTimeout("begin()",3000)
}
return true
}
window.onerror=correct
function begin(){
if (!document.all)
return
if (maxheight==null)
maxheight=temp.offsetHeight
whatsnew.style.height=maxheight
temp.style.display="none"
c=1
finished=true
change()
}
//-->
</script>
<style>
<!--
#whatsnew a{color:ffffff;text-decoration:none}
#whatsnew, #temp {font-weight:bold; font-family:Arial}
#whatsnew a:hover{color:red}
-->
</style>
<script language="javascript1.2">
<!--
var head=''
var top=0
var maxheight
var finished=false
var tickers=new Array()
tickers[0]='<a href="http://scriptic.ru">Красивый эффект.</a>'
tickers[1]='<a href="http://scriptic.ru">Это сообщение - ссылка.</a>'
tickers[2]='<a href="http://scriptic.ru">Меняет цвет при наведении мыши.</a>'
tickers[3]='<a href="http://scriptic.ru">Несложный короткий код.</a>'
tickers[4]='<a href="http://scriptic.ru">Один из множества скриптов с scriptic.ru.</a>'
for (i=1;i<=tickers.length-1;i++){
if (tickers[i].length>=tickers[top].length)
top=i-1
}
if (document.all)
document.write('<span id="whatsnew" style="width:100%;height=10;filter:revealTrans(duration=2,transition=19)">'+tickers[0]+'</span>')
function change(){
whatsnew.innerHTML=''
whatsnew.filters.revealTrans.apply()
whatsnew.filters.revealTrans.play()
whatsnew.innerHTML=tickers[c]
if (c==tickers.length-1)
c=0
else
c+=1
setTimeout("change()",5000)
}
if (document.all)
document.write('<span id=ns style="display:none;">')
//-->
</script>
</span>
<span id=temp style="position:absolute;left:0;top:0" style=&{head};>
<script>
<!--
if (document.all){
temp.style.width=whatsnew.style.width
document.write(tickers[top])
}
//-->
</script>
</span><br>
</center>
</body>
</html>
Дизайн Scriptic
Самые Часто Используемые Скрипты 20.05.2008 21:36
Ссылки светятся ( при наведении курсора)
Цитата:
<html>
<head>
<title>Ссылки светятся ( при наведении курсора)</title>
<style type="text/css">
.nav { COLOR: #ffff00; FONT-FAMILY: arial; FONT-SIZE: 10pt; LEFT: 150px; POSITION: absolute; TEXT-DECORATION: none}
</style>
<SCRIPT language="JavaScript">
<!--
var i_strength=0
var max_strength=6
var shadowcolor="red"
var timer
var speed=50
var thisobj
function stopfilter(thisdiv){
if (document.all) {
clearTimeout(timer)
thisobj=thisdiv
thisobj.style.filter=" "
}
}
function startfilter(thisdiv){
if (document.all) {
clearTimeout(timer)
thisobj=thisdiv
morefilter()
}
}
function morefilter(){
if (i_strength <=max_strength) {
thisobj.style.filter="glow(color="+shadowcolor+", strength="+i_strength+")"
i_strength++
timer = setTimeout("morefilter()",speed)
}
else {
clearTimeout(timer)
lessfilter()
}
}
function lessfilter(){
if (i_strength >=0) {
thisobj.style.filter="glow(color="+shadowcolor+", strength="+i_strength+")"
i_strength--
timer = setTimeout("lessfilter()",speed)
}   
else {
clearTimeout(timer)
morefilter()
}
}
//  -->
</SCRIPT>
</head>
<body>
<div class="nav" id="news" onmouseout="stopfilter(this)" onmouseover="startfilter(this)" style="TOP: 10px"><a href="http://studia.scriptic.ru" style="color: #ffff00">ГЛАВНАЯ СТРАНИЦА</a></div>
<div class="nav" id="contact" onmouseout="stopfilter(this)" onmouseover="startfilter(this)" style="TOP: 30px"><a href="http://studia.scriptic.ru" style="color: #ffff00">JAVASCRIPT</a></div>
</body>
</html>
Дизайн Scriptic
Самые Часто Используемые Скрипты 20.05.2008 21:35
При наведениии на сссылку появляется текст, который постепенно увеличивается и меняет цвет,а на его месте появляется другой
Цитата:
<html>
<head>
<title>При наведениии на сссылку появляется текст, который постепенно увеличивается и меняет цвет,а на его месте появляется другой.</title>
<script language="JavaScript" type="text/javascript">
// the number of rings
var ringnumber=4

// do not edit the code below
var x,y
var timer
var i_fontsize=new Array
var step=new Array
ringnumber=ringnumber-1
var maxfontsize=600
var startfontsize=1

for (i=0;i<=ringnumber;i++) {
i_fontsize[i]=startfontsize
step[i]=ringnumber*i*10
startfontsize=(maxfontsize/ringnumber)*(i+1)
}

function cursorposition(e){
x=event.clientX+document.body.scrollLeft
y=event.clientY+document.body.scrollTop
}

function showrings() {
if (document.all) {
for (i=0;i<=ringnumber;i++) {
  if (i_fontsize[i]>=maxfontsize) {i_fontsize[i]=1;step[i]=1}
  var thisring=eval("document.all.ring"+i+".style")
  thisring.visibility="visible"
  thisring.fontSize=i_fontsize[i]
  thisring.color="rgb("+Math.floor(i_fontsize[i]/2.0)+","+Math.floor(i_fontsize[i]/2.0)+",255)"
     thisring.posLeft=x-(Math.floor(i_fontsize[i]/3))
  thisring.posTop=y-(Math.floor(i_fontsize[i]/1.4))
  step[i]+=2
  i_fontsize[i]+=step[i]
}
timer=setTimeout("showrings()",50)
}
}

function hiderings(e){
if (document.all) {
clearTimeout(timer)
startfontsize=0
for (i=0;i<=ringnumber;i++) {
  thisring=eval("document.all.ring"+i+".style")
  thisring.visibility="hidden"
  i_fontsize[i]=startfontsize
  step[i]=ringnumber*i*10
  startfontsize=Math.floor((maxfontsize/ringnumber))*(i+1)
}
}
}

if (document.all) {
document.onmousemove=cursorposition;
}

if (document.all) {
for (i=0;i<=ringnumber;i++) {
document.write("<DIV id='ring"+i+"' style='position:absolute;font-family:Verdana;'>°</DIV>")
}
document.write("<DIV style='position:relative;'>")
}
</script>
</head>
<body>
<a href="http://scriptic.narod.ru" onMouseOver="showrings()" onMouseOut="hiderings()">Scriptic.narod.ru</a>
</body>
</html>
Дизайн Scriptic
Часы, таймеры, календари 20.05.2008 21:27
Скрипт выводит время до события (праздника).
Цитата:
<html>
<head>
<title>Скрипт выводит время до события (праздника).</title>
<script language="JavaScript"><!--
function cntdown1(){
today = new Date()
nextEVENT = new Date("January 1, 3000")
msPerDay = 24 * 60 * 60 * 1000 ;daysLeft = (nextEVENT.getTime() - today.getTime()) / msPerDay;daysLeft = Math.round(daysLeft);document.write("До 3000 года осталось <FONT COLOR=\"#ffff00\">" + daysLeft + " дней(я)</FONT><br>") ;
minutesLeft=(nextEVENT.getTime() - today.getTime()) / 60000;
minutesLeft = Math.round(minutesLeft);
document.write("Или точнее <FONT COLOR=\"#ffff00\">" + minutesLeft + " минут(ы)</FONT>") ;
}//--></script>
</head>
<body>
<script>cntdown1()</script>
</body>
</html>
Дизайн Scriptic.
Часы, таймеры, календари 20.05.2008 21:26
Часы фоном. Можно менять размер, расположение и цветовую гамму часов.
Цитата:
<html>
<head>
<title>Часы фоном. Можно менять размер, расположение и цветовую гамму часов.</title>
</head>
<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:Verdana;color:FFAAAAA;font-size:120px;top:10px;left:12px">'+thistime+'</div>')
  document.bgclocknoshade.document.write('<div id="bgclocknoshade" style="position:absolute;visibility:visible;font-family:Verdana;color:DDDDDD;font-size:120px;top:10px;left:10px">'+thistime+'</div>')
  document.close()
}
var timer=setTimeout("clockon()",200)
}

// - End of JavaScript - -->
</script>
</head>
<body onLoad="">
<div id="bgclockshade" style="position:absolute; visibility:visible; font-family:Verdana; color:#006600; font-size:36px; top:10px; left:290px"></div>
<div id="bgclocknoshade" style="position:absolute; visibility:visible;font-family:Verdana; color:#009900; font-size:36px; top:9px; left:287px"></div>
<div id="mainbody" style="position:absolute; visibility:visible"></div>
</body>
</html>
Дизайн Scriptic.
Часы, таймеры, календари 20.05.2008 21:23
Часы в бегущей строке поля формы.
Цитата:
<head>
<title>Часики в бегущей строке</title>
</head>
<script LANGUAGE="javascript">
var id 
var position=0
var numofloop=10
function banner()  {   
var nor = new Date()
var minutes = nor.getMinutes()
var hours = nor.getHours()
var seconds = nor.getSeconds()
var nortime = "В мнастоящий момент "
nortime += ((hours > 12) ? hours - 12 : hours)
nortime += ((minutes < 10) ? ":0" : ":") + minutes
nortime += ((seconds < 10) ? ":0" : ":") + seconds
nortime += (hours >= 12) ? " после полудня" : " до полудня"
var msg="                                        А знаете сколько сейчас времени?  " + nortime + "                                                 ";
var pace=10;
document.form.banner.value=msg.substring(position,position+75) ;
if  (position++==msg.length)  {
if  (numofloop-- < 2) return;
position=0;
}
id=setTimeout ("banner()", 1000/pace);
}
</script>
<body onload="banner()">
<form name="form">
<input type="text" name="banner" size="40">
</form>
</body>
</html>
Дизайн Scriptic.
Часы, таймеры, календари 20.05.2008 21:21
Часы в форме, формат вывода 12:13:59
Цитата:
<html>
<head>
<title>Время.</title>
</head>
<body onLoad="myclock()">
<script language="JavaScript">
<!--
function myclock()
{
ndata=new Date()
// Получение показаний часов, минут и секунд
hours= ndata.getHours();
mins= ndata.getMinutes();
secs= ndata.getSeconds();
// Дополнение показаний нулем слева
if (hours < 10) {hours = "0" + hours }
if (mins < 10) {mins = "0" + mins }
if (secs < 10) {secs = "0" + secs }
// Суммирование всех данных для вывода
datastr =hours+":" + mins+":" +secs
// Запись данных
document.clockexam.clock.value = " "+datastr;
// Вызов функции с интервалом 1000 ms
setTimeout("myclock()", 1000);
}
-->
</script>
<form name="clockexam"><input type="text" size="9" name="clock"></form>
</body>
</html>
Дизайн Scriptic.
Часы, таймеры, календари 20.05.2008 21:19
Часы, формат вывода 12:13:59
Цитата:
<html>
<head>
<title>Время.</title>
<script language="JavaScript">
<!--
ndata = new Date();
hours = ndata.getHours();
mins = ndata.getMinutes();
secs = ndata.getSeconds();
if (hours < 10) {hours = "0" + hours }
if (mins < 10) {mins = "0" + mins }
if (secs < 10) {secs = "0" + secs }
datastr = ( hours + ":" + mins + ":"+secs )
-->
</script>
</head>
<body>
<font face="Arial" size="3" color="#b00000">
<script language="JavaScript">
<!--
document.write(datastr);
-->
</script>
</font>
</body>
</html>
Дизайн Scriptic.
Какие разделы не хватают форуму? 19.05.2008 21:12
Раздел помощи с оформлением форумов и сайтов. Иногда так не хватает нужных ссылочек и просто добрых людей, что хоть на стенку лезь.