JavaScript onmousemove 事件

JavaScript onmousemove 事件DefinitionandUsage定义与用法Theonmousemoveeventoccurswhenthemousepointerismoved.当鼠标移动时触发onmou

大家好,又见面了,我是你们的朋友全栈君。

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:
输出结果为:

w3pop


Try-It-Yourself Demos
互动演示

onmousemove
How to use onmousemove.
如何应用onmousemove
转载 http://www.w3pop.com/tech/school/jsref/jsref_onmousemove.asp

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/155399.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 数论 同余定理

    数论 同余定理同余定理给定一个正整数 m 如果两个整数 a 和 b 满足 a b 能够被 m 整除 即 a b m 得到一个整数 那么就称整数 a 与 b 对模 m 同余 记作 a b modm 对模 m 同余是整数的一个等价关系 记法 a b modd 性质 反身性 对称性 传递性等同余符号两个整数 a b 若它们除以整数 m 所得的余数相等 则称 a 与 b 对于模 m 同余或 a 同余于 b 模 m 记作 a b modm

    2025年7月14日
    4
  • Redis在SpringBoot的基本使用

    Redis在SpringBoot的基本使用一、配置1.添加依赖在springboot启动器中直接添加依赖,或者创建后添加Maven依赖:<!–spring-boot-starter-data-redis–>&l

    2022年8月16日
    13
  • 最小二乘法进行线性回归_最小二乘法简单例题

    最小二乘法进行线性回归_最小二乘法简单例题最小二乘法概述对于一元线性回归模型,假设从总体中获取了n组观察值(x1,y1)(x1,y1)(x_1,y_1),(x2,y2)(x2,y2)(x_2,y_2),…,(xn,yn)(xn,yn)(x_n,y_n)。对于平面中的这n个点,可以使用无数条曲线来拟合。要求样本回归函数尽可能好地拟合这组值。综合起来看,这条直线处于样本数据的中心位置最合理。选择最佳拟合曲线的标准可以确定为:使总的拟…

    2022年9月25日
    5
  • Docker这个新软件究竟是用来干嘛的???

    Docker这个新软件究竟是用来干嘛的???

    2022年2月10日
    34
  • lldp 命令「建议收藏」

    lldp 命令「建议收藏」LLDP协议介绍:简单说来,LLDP是一种邻近发现协议。它为以太网网络设备,如交换机、路由器和无线局域网接入点定义了一种标准的方法,使其可以向网络中其他节点公告自身的存在,并保存各个邻近设备的发现信息。例如设备配置和设备识别等详细信息都可以用该协议进行公告。具体来说,LLDP定义了一个通用公告信息集、一个传输公告的协议和一种用来存储所收到的公告信息的方法。要公告自身信息的设备…

    2022年5月28日
    71
  • android源码学习:ActivityManager类全理解

    android源码学习:ActivityManager类全理解android.app下有个ActivityManager类,给类的作用,官方的解释是:这个类提供有关、交互、activities,services和包含process的信息。这个类中的许多方法都是为了调试或信息的目的,它们不应该被用来影响应用程序的运行时行为,这些方法在方法级文档中被调用。大多数应用程序开发人员不应该使用这个类,大多数的方法都是专门用例的。然而,一些方法更广泛地适

    2022年5月16日
    55

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号