Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2009.01.18;
Скачать: CL | DM;

Вниз

JavaScript   Найти похожие ветки 

 
АгатаКристи   (2008-11-20 00:01) [0]

Нужна помощь...
Нужно придать переменным S1 и S2 значения координат мыши.

<html>
<head>
   <title>Sun system</title>
   <script type="text/javascript">
     var fi = 0
     var EL
     var ET
    var s1
     var s2
 

     function Move()
{

fi+=0.01;
     s1=460;
s2=360;
Sun.style.left=s1;
Sun.style.top=s2;
     Earth.style.left = 150*Math.cos(fi)+s1+25;
     Earth.style.top = 120*Math.sin(fi)+s2+25;
     EL = 150*Math.cos(fi)+s1+25;
     ET = 120*Math.sin(fi)+s2+25;

     Venus.style.left = 100*Math.cos(1.25*fi)+s1+25;
     Venus.style.top = 80*Math.sin(1.25*fi)+s2+25;
     Mercury.style.left = 70*Math.cos(1.56*fi)+s1+30
     Mercury.style.top = 56*Math.sin(1.56*fi)+s2+32;
     Mars.style.left = 200*Math.cos(0.75*fi)+s1+30;
     Mars.style.top = 160*Math.sin(0.75*fi)+s2+30;
     Jupiter.style.left = 250*Math.cos(0.56*fi)+s1+10;
     Jupiter.style.top = 200*Math.sin(0.56*fi)+s2+10;
     Saturn.style.left = 320*Math.cos(0.42*fi)+s1+15;
     Saturn.style.top = 256*Math.sin(0.42*fi)+s2+15;
     Uranus.style.left = 360*Math.cos(0.31*fi)+s1+20;
     Uranus.style.top = 288*Math.sin(0.31*fi)+s2+20;
     Neptune.style.left = 420*Math.cos(0.23*fi)+s1+20;
     Neptune.style.top = 336*Math.sin(0.23*fi)+s2+20;
     Pluto.style.left = 460*Math.cos(0.17*fi)+s1+20;
     Pluto.style.top = 368*Math.sin(0.17*fi)+s2+20;
     Moon.style.left = 35*Math.cos(2*fi)+ EL;
     Moon.style.top =35*Math.sin(2*fi)+ ET;

     }

   </script>
</head>
<body  onload="Start()" >

<div style="text-align:right; color:blue;">

</div>
<script type="text/javascript">

</script>

</body>
</html>



 
KilkennyCat ©   (2008-11-20 01:00) [1]

http://evolt.org/article/Mission_Impossible_mouse_position/17/23335/?format=print



Страницы: 1 вся ветка

Текущий архив: 2009.01.18;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.013 c
2-1228290164
DimonS
2008-12-03 10:42
2009.01.18
Возможно ли сгруппировать записи без ограничивающих пробелов?


2-1228379830
b@v
2008-12-04 11:37
2009.01.18
База данных


15-1227050125
Германн
2008-11-19 02:15
2009.01.18
Ох уже эти бабы!


2-1228294295
NieL
2008-12-03 11:51
2009.01.18
Сохранение геометрических параметров формы


2-1228399322
LLiriKK
2008-12-04 17:02
2009.01.18
Проблема с Word