本文介紹了是否有用于“鼠標釋放"的 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 屬性/事件處理程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!