English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
استخدام خاصية onmousemove في HTML لاستخراج أو تعيين وظيفة معالجة الحدث لمؤشر الفأرة
عندما يضع مؤشر الفأرة على الصورة، يتم تنفيذ لغة JavaScript:
<!DOCTYPE html> <html> <head> <title>استخدام خاصية HTML onmousemove (دليل أساسي oldtoolbag.com)</title> </head> <body> <img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32"> <p>عندما يضع المستخدم مؤشر الفأرة فوق الصورة، يتم تنفيذ وظيفة bigImg(). هذه الوظيفة تضخم الصورة.<br> عندما يخرج مؤشر الفأرة من الصورة، يتم تنفيذ وظيفة normalImg(). هذه الوظيفة تضبط طول وعرض الصورة إلى القياسية.</p> <script> function bigImg(x) { x.style.height = "64px"; x.style.width = "64px"; } function normalImg(x) { x.style.height = "32px"; x.style.width = "32px"; } </script> </body> </html>اختبار لمعرفة ‹/›
IEFirefoxOperaChromeSafari
دعم خاصية onmousemove لجميع المتصفحات الشائعة
سيتم تحفيز خاصية onmousemove عند تحرك المؤشر فوق العنصر.
ملاحظة: لا يمكن استخدام خاصية onmousemove في العناصر التالية: <base>, <bdo>, <br>، <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, أو<title>.
ليس هناك.
<عنصر onmousemove="سكربت">
القيمة | وصف |
---|---|
سكربت | يحدد السكربت الذي سيتم تنفيذه عند تحفيز حدث onmousemove. |