Убегающая кнопка. При нажатии на кнопку она убегает от курсора.
Code
<center><button style="background-color:red;height:25px;width:80px;" onmouseDown="alert('Отлично, мы планируем понижение её на 30% !!!');parent.location='http://ssilki.at.ua'" value="ДА!!!">ДА!!!</button>
<SPAN id="button1" style="position:relative;z-index:10" onmouseOver="moveIt()" onfocus="moveIt();this.blur()">
<button style="background-color:lightgreen;height:25px; width:80px;" onmouseDown="moveIt()" onmouseover="moveIt()" onfocus="moveIt();this.blur()">Нет</button>
</SPAN></P>
</center>
<script>
function getObj(objID)
{
if (document.getElementById) {return document.getElementById(objID);}
else if (document.all) {return document.all[objID];}
else if (document.layers) {return document.layers[objID];}
}
var ie4=document.all
var ns6=document.getElementById&&!document.all
cobj=getObj("button1");
function moveIt(){
y=Math.floor(Math.random()*301);
x=Math.floor(Math.random()*401);
if (ie4){
cobj.style.top = y;
cobj.style.left = x;
}
else if (ns6){
cobj.style.top = y+"px";
cobj.style.left = x+"px";
}
}
</script>
Размеры, цвет, надписи кнопок можно изменять!
Пример смотрите тут
Этот скрипт можно использовать в опросах, голосованиях и т. д.(например вам нравится мой сайт и т. д.)
Возникнут сложности пишите, помогу!