Страница 1 из 1

Скрипт случайного смайла.

СообщениеДобавлено: 29 июн 2008, 04:54
Boxe
Кто можит дат скрипт для того чтоби на каждие 10 секун или менше болше чтоби виходили призраки или смаилики.Но чтоби виходил один призрак или смаилик.и по разним местам страници.В смисле не на одном и томже месте.

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 06:25
rider1203
на офф сайте фильма "Хоттабыч" есть такая херня

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 11:34
Murcielago
дай ссылку на сайт

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 11:58
†Angel†
Murcielago писал(а):дай ссылку на сайт

http://hottabych.net/screenmate/

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 13:25
google08
Код: Выделить всё
<script type="text/javascript" src="http://hottabych.net/smile/code.txt"></script>


Содержимое файла http://hottabych.net/smile/code.txt :
Спойлер: Показать +
if(document.cookie.indexOf('hottab=')==-1){
var hott1=new Image(18, 33);
var hott2=new Image(18, 33);
hott1.src="Первая картинка";
hott2.src="Вторая картинка";
document.write("<div id='hottab'><a href='Твой сайт' target='_blank'><img alt='Хоттабыч' width='18' height='33' border='0' /></a></div>");
document.getElementById('hottab').style.position='absolute';
var sHeight=screen.height-20;
var sWidth=screen.width-400;
document.getElementById('hottab').style.top=sHeight*Math.random()+10+'px';
document.getElementById('hottab').style.left=sWidth*Math.random()+10+'px';
document.getElementById('hottab').style.display='none';
document.getElementById('hottab').style.filter="alpha(opacity:0)";
document.getElementById('hottab').style.KHTMLOpacity="0";
document.getElementById('hottab').style.MozOpacity="0";
document.getElementById('hottab').style.opacity="0";
document.getElementById('hottab').getElementsByTagName('img')[0].src=hott1.src;
setTimeout("pshih(1, 0);", Math.random()*10000+10000);
function smex(pik, kol){
document.getElementById('hottab').getElementsByTagName('img')[0].src=hott2.src;
if(kol<20){
if(pik){
document.getElementById('hottab').style.top=parseInt(document.getElementById('hottab').style.top)-2+'px';
pik=0;
}else{
document.getElementById('hottab').style.top=parseInt(document.getElementById('hottab').style.top)+2+'px';
pik=1;
}
setTimeout('smex('+pik+', '+(kol+1)+');', 50);
}else{
document.getElementById('hottab').getElementsByTagName('img')[0].src=hott1.src;
setTimeout("pshih(0, 100);", 100);
}
}
function pshih(vis, value){
if(vis){
if(value==0){
if(document.body.scrollTop){
var scrollT=document.body.scrollTop;
}else if(window.pageYOffset){
var scrollT=window.pageYOffset;
}else{
scrollT=0;
}
document.getElementById('hottab').style.top=parseInt(document.getElementById('hottab').style.top)+scrollT+'px';
}
if(value>=100){
smex(1, 0);
document.getElementById('hottab').style.filter="alpha(opacity:100)";
document.getElementById('hottab').style.KHTMLOpacity="1";
document.getElementById('hottab').style.MozOpacity="1";
document.getElementById('hottab').style.opacity="1";
}else{
document.getElementById('hottab').style.display='block';
value=value+4;
if(value<10){var b='0';}else{var b='';}
document.getElementById('hottab').style.filter="alpha(opacity:"+value+")";
document.getElementById('hottab').style.KHTMLOpacity="0."+b+value;
document.getElementById('hottab').style.MozOpacity="0."+b+value;
document.getElementById('hottab').style.opacity="0."+b+value;
setTimeout('pshih(1, '+value+')', 1);
}
}else{
if(value<=0){
document.getElementById('hottab').style.display='none';
document.getElementById('hottab').style.filter="alpha(opacity:0)";
document.getElementById('hottab').style.KHTMLOpacity="0";
document.getElementById('hottab').style.MozOpacity="0";
document.getElementById('hottab').style.opacity="0";
var date = new Date();
date.setMinutes(date.getMinutes());
document.cookie="hottab=1; expires="+date.toGMTString()+"; path=/;";
}else{
value=value-4;
if(value<10){var b='0';}else{var b='';}
document.getElementById('hottab').style.filter="alpha(opacity:"+value+")";
document.getElementById('hottab').style.KHTMLOpacity="0."+b+value;
document.getElementById('hottab').style.MozOpacity="0."+b+value;
document.getElementById('hottab').style.opacity="0."+b+value;
setTimeout('pshih(0, '+value+')', 1);
}
}
}
}

или
var shat1=new Image(18, 33);
var shat2=new Image(18, 33);
shat1.src="Первая картинка";
shat2.src="Вторая картинка";
document.write("<div id='shaiten'><img alt='Шайтаныч' width='18' height='33' border='0'/></div>");
document.getElementById('shaiten').style.position='absolute';
var sHeight2=screen.height;
var sWidth2=screen.width;
document.getElementById('shaiten').style.top=sHeight2*Math.random()+10+'px';
document.getElementById('shaiten').style.left=sWidth2*Math.random()+10+'px';
document.getElementById('shaiten').style.display='none';
document.getElementById('shaiten').style.filter="alpha(opacity:0)";
document.getElementById('shaiten').style.KHTMLOpacity="0";
document.getElementById('shaiten').style.MozOpacity="0";
document.getElementById('shaiten').style.opacity="0";
document.getElementById('shaiten').getElementsByTagName('img')[0].src=shat1.src;
setTimeout("pshih2(1, 0);", 3000);
function smex2(pik2, kol2){
document.getElementById('shaiten').getElementsByTagName('img')[0].src=shat2.src;
if(kol2<20){
if(pik2){
document.getElementById('shaiten').style.top=parseInt(document.getElementById('shaiten').style.top)-2+'px';
pik2=0;
}else{
document.getElementById('shaiten').style.top=parseInt(document.getElementById('shaiten').style.top)+2+'px';
pik2=1;
}
setTimeout('smex2('+pik2+', '+(kol2+1)+');', 50);
}else{
document.getElementById('shaiten').getElementsByTagName('img')[0].src=shat1.src;
setTimeout("pshih2(0, 100);", 10);
}
}
function pshih2(vis2, value2){
if(vis2){
if(value2==0){
if(document.body.scrollT2op){
var scrollT2=document.body.scrollT2op;
}else if(window.pageYOffset){
var scrollT2=window.pageYOffset;
}else{
scrollT2=0;
}
document.getElementById('shaiten').style.top=parseInt(document.getElementById('shaiten').style.top)+scrollT2+'px';
}
if(value2>=100){
smex2(1, 0);
document.getElementById('shaiten').style.filter="alpha(opacity:100)";
document.getElementById('shaiten').style.KHTMLOpacity="1";
document.getElementById('shaiten').style.MozOpacity="1";
document.getElementById('shaiten').style.opacity="1";
}else{
document.getElementById('shaiten').style.display='block';
value2=value2+4;
if(value2<10){var b='0';}else{var b='';}
document.getElementById('shaiten').style.filter="alpha(opacity:"+value2+")";
document.getElementById('shaiten').style.KHTMLOpacity="0."+b+value2;
document.getElementById('shaiten').style.MozOpacity="0."+b+value2;
document.getElementById('shaiten').style.opacity="0."+b+value2;
setTimeout('pshih2(1, '+value2+')', 1);
}
}else{
if(value2<=0){
document.getElementById('shaiten').style.display='none';
document.getElementById('shaiten').style.filter="alpha(opacity:0)";
document.getElementById('shaiten').style.KHTMLOpacity="0";
document.getElementById('shaiten').style.MozOpacity="0";
document.getElementById('shaiten').style.opacity="0";
document.getElementById('shaiten').style.top=sHeight2*Math.random()+10+'px';
document.getElementById('shaiten').style.left=sWidth2*Math.random()+10+'px';
setTimeout("pshih2(1, 1);", 2000);
}else{
value2=value2-4;
if(value2<10){var b='0';}else{var b='';}
document.getElementById('shaiten').style.filter="alpha(opacity:"+value2+")";
document.getElementById('shaiten').style.KHTMLOpacity="0."+b+value2;
document.getElementById('shaiten').style.MozOpacity="0."+b+value2;
document.getElementById('shaiten').style.opacity="0."+b+value2;
setTimeout('pshih2(0, '+value2+')', 1);
}
}
}


ЗЫ:Зеленое заменить на свое ;)

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 15:57
Boxe
Спасибо)) А подскажите куда ети коди вставит чтоби на форуме виходили такие смаили или призраки.
и каки код куда встаит.

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 16:01
Boxe
Круто еше незнал о таком сайте)))))

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 18:56
Boxe
помогите кто можит куда нужно вставит ети коди?

Re: Скрипт случайного смайла

СообщениеДобавлено: 29 июн 2008, 20:00
google08
Boxe писал(а):помогите кто можит куда нужно вставит ети коди?

<script type="text/javascript" src="http://hottabych.net/smile/code.txt"></script> - ставишь между <head> и </head> или <body> и </body>