دوارة حول الماوس
2 مشترك
صفحة 1 من اصل 1
دوارة حول الماوس
الكود التالي يضع دوارة حول الماوس
جرب!
<html>
<head>
<script>
</script>
</head>
<body>
<div id="rotor5" style="position: absolute;left:600">أهلاً</div>
<div id="rotor4" style="position: absolute;eft:000">و</div>
<div id="rotor3" style="position: absolute;left:100">سهلاً</div>
<div id="rotor2" style="position: absolute;left:200">بكم</div>
<div id="rotor1" style="position: absolute;left:300">في</div>
<div id="rotor0" style="position: absolute;left:400">المنتدى</div>
<script language='javascript'>
t = 0
cx= 200;cy = 200;
document.body.onmousemove = mouseMove;
function mouseMove(){cx = event.clientX;cy = event.clientY}
function Rotor(){
t += 0.2
i = 0;rx=100;ry = 100;
while(i < 6){
document.getElementById('rotor' + i).style.posLeft = cx + Math.round(-rx*Math.cos(t + 0.5*i));
document.getElementById('rotor' + i).style.posTop = cy + Math.round(-ry*Math.sin(t + 0.5*i));
i += 1
}
}
window.setInterval("Rotor()",50);
</script>
<body>
</html>
جرب!
<html>
<head>
<script>
</script>
</head>
<body>
<div id="rotor5" style="position: absolute;left:600">أهلاً</div>
<div id="rotor4" style="position: absolute;eft:000">و</div>
<div id="rotor3" style="position: absolute;left:100">سهلاً</div>
<div id="rotor2" style="position: absolute;left:200">بكم</div>
<div id="rotor1" style="position: absolute;left:300">في</div>
<div id="rotor0" style="position: absolute;left:400">المنتدى</div>
<script language='javascript'>
t = 0
cx= 200;cy = 200;
document.body.onmousemove = mouseMove;
function mouseMove(){cx = event.clientX;cy = event.clientY}
function Rotor(){
t += 0.2
i = 0;rx=100;ry = 100;
while(i < 6){
document.getElementById('rotor' + i).style.posLeft = cx + Math.round(-rx*Math.cos(t + 0.5*i));
document.getElementById('rotor' + i).style.posTop = cy + Math.round(-ry*Math.sin(t + 0.5*i));
i += 1
}
}
window.setInterval("Rotor()",50);
</script>
<body>
</html>
Mohanad- قـيـد التسجيل
-
عدد الرسائل : 1
تاريخ التسجيل : 21/09/2007
رد: دوارة حول الماوس
الكود شغال 100% اخوي مهند جزاك الله الف خير مبدع والله ولكن بقي ان اوضح للاعضاء طريقة استخدامه..
انسخ الكود الى ملف text جديد وبعد حفظه قم بتغيير امتداد الملف من txt الى html و افتحه..
انسخ الكود الى ملف text جديد وبعد حفظه قم بتغيير امتداد الملف من txt الى html و افتحه..
The Joker- ๑۩۞۩๑عضو ذهـبـي๑۩۞۩๑
-
عدد الرسائل : 105
العمر : 34
العمل : طــــــــــــــــــــــــالب
الدراسة : 2/هـ.كهربائية
الحالة الاجتماعية : اعزب
تاريخ التسجيل : 08/09/2007
بيانات العضو:
من مواضيعي:
تعاليق المديرون والمشرفون:
المزاج اليوم:
صفحة 1 من اصل 1
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى