简体   繁体   English

移动设备上的范围输入滑块

[英]range Input slider on mobile

I'm using the default html5 input range object for a custom audio player.我正在为自定义音频播放器使用默认的 html5 输入范围对象。 Everything works fine, all the events get fired when I need them and stuff, except I have on annoying issue on my mobile Safari with iOS 11.4:一切正常,所有事件在我需要它们时都会被触发,除非我在 iOS 11.4 的移动 Safari 上遇到烦人的问题:

When I tap on the seekbar/slider, the 'thumb' doesn't jump to the tapped position.当我点击搜索栏/滑块时,“拇指”不会跳到点击位置。 I noticed that is the case with any input slider object that I test on my device.我注意到我在我的设备上测试的任何输入滑块对象都是这种情况。

Changing the thumb position by dragging it with onTouchStart/onTouchEnd works fine however.但是,通过使用 onTouchStart/onTouchEnd 拖动来更改拇指位置可以正常工作。

Anyone who can help me with this problem?谁能帮我解决这个问题?

Thanks!谢谢!

It looks like a solution may be posted in this SO post .看起来这个 SO post 中可能会发布一个解决方案。

I have exactly the same problem, only with an iPhone.我有完全相同的问题,只有 iPhone。

This is because Mobile Safari only supports a subset of HTML5.这是因为 Mobile Safari 只支持 HTML5 的一个子集。 I am using JqTouch which is causing me all manner of issues so do avoid this framework.我正在使用 JqTouch,这给我带来了各种各样的问题,因此请避免使用此框架。

Take a look at jquery mobile.看看jquery mobile。 Its currently Alpha 3, but has a slider control which works on iOS.它目前是 Alpha 3,但有一个适用于 iOS 的滑块控件。

Hope this helps you a little.希望这对你有一点帮助。

And another answer suggests using the range-touch library, but assumes you have JQuery for this.另一个答案建议使用range-touch库,但假设您对此有 JQuery。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM