触摸友好的工具提示
有人知道包含移动设备解决方案的 Jquery 工具提示吗?由于悬停状态不起作用,我猜我需要一些在点击时也起作用的东西。也许它的行为就像点击时的模式框?只是把东西扔到这里。不确定最好的解决方案是什么。
--更新--
我真的很喜欢@Alveoli建议的解决方案,但我最终自己尝试了一下。我使用 qTip 作为基础,并编写了一些弗兰肯斯坦代码来创建触摸友好的工具提示和移动友好的模式框。任何优化代码的帮助将不胜感激。这是小提琴...http://jsfiddle.net/cssguru/NQRBT/
Anyone know of a Jquery tool tip that includes a solution for mobile devices? Since the Hover state doesn't work, I'm guessing I need something that also works on click. Maybe it behaves like a modal box on click? Just throwing stuff out here. Not sure what the best solution would be.
-- Update --
I really like the solution @Alveoli suggested, but I ended up taking a stab at it myself. I used qTip as my base and wrote some Frankenstein'd code to create both touch friendly tooltips and mobile friendly modal boxes. Any help optimizing the code would be greatly appreciated. Here is the fiddle...http://jsfiddle.net/cssguru/NQRBT/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我正在寻找同样的东西并找到了这个优雅的解决方案:
http://osvaldas.info/blog/elegant-css-and-jquery-tooltip-responsive-mobile-Friendly
额外的好处是,在移动设备上,当您触摸它时它会“粘住”,而当您触摸它时它会消失你再碰它。
I'm looking for the same thing and found this elegant solution:
http://osvaldas.info/blog/elegant-css-and-jquery-tooltip-responsive-mobile-friendly
Bonus is that on a mobile it 'sticks' when you touch it and disappears when you touch it again.
您可以使用 jQuery UI 工具提示 并确保工具提示在页面中的任何触摸时关闭,如下所示:
You could use jQuery UI Tooltip and make sure that the tooltip is closed on any touch in the page as follows:
我曾经尝试过一个应用程序,它的工具提示是延迟加载的。例如,UI 上显示一个名为“提交”的按钮,3 秒后,标签“将数据提交到服务器”在“提交”按钮下方显示为工具提示。
考虑到新用户总是需要更多时间来完成操作,我认为这是实现工具提示的好方法。高级用户不会被打扰,而新用户在一段时间后可以看到工具提示。
I used to try an app, and its tooltips are lazy loaded. For example, a button called 'Submit' is displayed on the UI, and then 3 seconds later, the label 'Sumit your data to the server' shows as a tooltip below the 'Submit' button.
Considering the fresh users always need more time to completed actions, I think it is a good way to implement the tooltip. Senior users won't be bothered while fresh users could see the tooltip after a while.