本文介紹了是否有用于“鼠標(biāo)釋放"的 HTML 屬性/事件處理程序?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我需要在釋放滑塊旋鈕時(shí)調(diào)用一個(gè)函數(shù).onchange
在我更改值時(shí)更改它.有沒有類似的解決方案
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
事件在手機(jī)上用于處理此用戶交互.
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 上觸發(fā)change"事件而不是input".
- IE10 &11 有 一些與步長值.
這篇關(guān)于是否有用于“鼠標(biāo)釋放"的 HTML 屬性/事件處理程序?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!