是否有用于“鼠标释放"的 HTML 属性/事件处理程序? [英] Is there an HTML attribute/event handler for 'on mouse release'?

查看:26
本文介绍了是否有用于“鼠标释放"的 HTML 属性/事件处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在释放滑块旋钮时调用一个函数.onchange 在我更改值时更改它.有没有类似的解决方案

I need a function to be called when the slider knob has been released. onchange changes the value while I'm changing it. Is there a solution for this like

<input type="range" min="0" max="1000" onrelease="callfunction()">

推荐答案

使用 mouseup 事件和 touchend 事件在手机上用于处理此用户交互.

Use the mouseup event on desktop browsers and the touchend event on mobile phones for handling this user interaction.

<input type="range" min="0" max="1" 
       onmouseup="callfunction()" 
       ontouchend="callfunction()">

我建议您查看 caniuse.com 以获得浏览器支持.

I would recommend to check caniuse.com for browser support.

已知问题(截至 2019-03-25):

这篇关于是否有用于“鼠标释放"的 HTML 属性/事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆