网页移植到移动设备 [英] webpage porting to mobile

查看:65
本文介绍了网页移植到移动设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的网站里面有一些内容。

最有趣的是一些div元素,定义了onclick(重定向到其他页面)和onmouseover(show关于它的小信息)方法。

但是移动浏览器没有鼠标悬停。



为移动网络浏览器实现此类设计的最佳做法是什么?

Hi,
I have a website with some content inside.
The most interesting is some div element with defined onclick (redirect to other page) and onmouseover ( show small information over it) methods.
However there is no mouseover on mobile browsers.

What are the best practices for implementing such design for mobile web browsers?

推荐答案

使用某些库这解决了这些问题,例如JQuery mobile做了:

http://jquerymobile.com/demos/1.1.0-rc.1/docs/api/events.html [ ^ ]



重新思考您的应用程序行为 - 例如,如果您在移动设备上,则单独处理第一次和第二次点击时替换鼠标悬停。
Using some library that addresses these concerns, for example JQuery mobile does:
http://jquerymobile.com/demos/1.1.0-rc.1/docs/api/events.html[^]

Rethinking your application behavior - for example, replacing on mouseover with separate handling of first and second click if you are on mobile device.


虽然它不是移动网站原生的,因此我可以使用悬停菜单。我发现最合理的方式来展示类似的东西是使用taphold(点击+保持)事件。所以在简单的触摸上做动作,并在触摸+保持 - 显示其他东西。
Although its not native to mobile web sites to have hover menus from what I''ve found the most reasonable way to show something similar is to use taphold (click + hold) event. So on simple touch do action, and on touch + hold - show something else.


这篇关于网页移植到移动设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆