Is there an HTML attribute/event handler for #39;on mouse release#39;?(是否有用于“鼠标释放的 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):
- IE10 &11 在 mousemove 上触发change"事件而不是input".
- IE10 &11 有 一些与步长值.
这篇关于是否有用于“鼠标释放"的 HTML 属性/事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否有用于“鼠标释放"的 HTML 属性/事件处理程序?


基础教程推荐
- 检查 HTML5 拖放文件类型 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01