Главная страница
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
15-1227520279
TUser
2008-11-24 12:51
2009.01.18
Портативный усилитель


1-1206530639
Igor_34
2008-03-26 14:23
2009.01.18
документ Word и компонент WebBrowser


15-1227508038
Xmen
2008-11-24 09:27
2009.01.18
Компоненты


2-1228633202
@!!ex
2008-12-07 10:00
2009.01.18
Узнать ProcessHandle по HWND окна.


2-1228244925
Serg
2008-12-02 22:08
2009.01.18
Статус интернет