JavaScript onmousemove 事件

來源:互聯網
上載者:User
Definition and Usage
定義與用法

The onmousemove event occurs when the mouse pointer is moved.
當滑鼠移動時觸發onmousemove事件

Syntax
文法
onmousemove="所要執行的代碼"

Parameter
參數
Description
注釋
SomeJavaScriptCode
所要執行的代碼
Required. Specifies a JavaScript to be executed when the event occurs.
必選項。當事件觸發時所要執行的代碼

Supported by the following HTML tags:
所支援的HTML標籤:

<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <div>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <ol>, <p>, <pre>, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>

Supported by the following JavaScript objects:
所支援的JavaScript對象:

onmousemove is, by default, not an event of any object, because mouse movement happens very frequently.
onmousemove在預設情況下不是任何一個對象的事件,因為滑鼠是頻繁移動的。

Tips and Notes
注意

Note: Each time a user moves the mouse one pixel, a mousemove event occurs. It takes system resources to process all mousemove events. Use this event carefully!
注意:當使用者滑鼠移動一像素時,就會觸發一次mousemove事件。這將非常消耗系統的資源,請謹慎使用。

Example
執行個體

In the following example we will display an alert box when the user moves the mouse pointer over the image:
在下面的例子中,當使用者的滑鼠在圖片上移動時將彈出一個訊息框:

<img src="image_w3default.gif" alt="W3pop"
onmousemove="alert('W3pop!')" />

The output of the code above will be:
輸出結果為:

Try-It-Yourself Demos
互動式示範

onmousemove
How to use onmousemove.
如何應用onmousemove
轉載 http://www.w3pop.com/tech/school/jsref/jsref_onmousemove.asp

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.