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 属性/事件处理程序?


基础教程推荐
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01