在移动网站上处理iPhone事件(如左侧幻灯片) [英] Handle iPhone Events (like slide-left) in Mobile Web Site

查看:78
本文介绍了在移动网站上处理iPhone事件(如左侧幻灯片)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPhone浏览器是否有我可以使用Javascript挂钩的特殊事件?例如,如果用户向左滑动,我想执行某个操作。如果有这样的事件可用,那么很高兴看到所有这些事件的参考。理想情况下,有一天会成为所有触摸屏移动浏览器的标准。

Does the iPhone browser have special events that I can hook into with Javascript? For instance, if the users slides to the left, I would like to perform a certain action. If there are events like this available, it would be nice to see a reference for all of them. ideally, there will someday be a standard for all touch-screen mobile browsers.

推荐答案

您可以访问多点触控事件和手势,但是你可能需要自己处理相当多的引擎盖管道。这是Apple的指南:

You can access multi-touch events and gestures, but there is a fair amount of under-the-hood plumbing you'll likely have to handle yourself. Here is Apple's guide:

https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html

作为使用MobileSafari网络应用程序可以做些什么的示例,请查看Apple内部PastryKit上的这篇文章:

As an example of what can be done with a MobileSafari web app, check out this article on Apple's in-house "PastryKit":

https://daringfireball.net/2009/12/pastrykit

特别是,您可以在Windows或Mac上使用Safari(如果您在首选项中启用开发人员菜单并将useragent设置为MobileSafari 3.x)并查看其工作方式。

Particularly, you can use Safari on Windows or Mac (if you enable the developer menu in the preferences and set the useragent to MobileSafari 3.x) and check out the way it works.

另一个要查看的UI库是jQTouch:

Another UI library to look at is jQTouch:

http://www.jqtouch.com/

这篇关于在移动网站上处理iPhone事件(如左侧幻灯片)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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