html - 在 Web 应用程序的网页之间滑动

标签 html webkit web-applications

我想创建一个网络应用程序(以避免必须为 iPhone、Android、BB 等单独编程)并且正在寻找滑动效果。是否有 HTML5 或 webkit 代码只是说“滑动到下一页/上一页”? (我知道它会比那更详细的代码,但这就是我想要的要点)

最佳答案

您可以使用 div 在网络浏览器中四处滑动,但不能滑动整个页面。也就是说,您只能在滑动影响后加载 div 中的页面,而不能移动整个页面本身。

仅适用于 chrome、safari。

如果您使用 jquery mobile,这里有一个代码。

$('body').live('swipeleft swiperight',function(event){
    if (event.type == "swiperight") {
       alert("swipped right side");      
    }
    if (event.type == "swipeleft") {
        alert("swipped left side");
    }
    event.preventDefault();
}); 

在这里引用更多 swipe detection

关于html - 在 Web 应用程序的网页之间滑动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10415372/

相关文章:

html - 移动 css 在智能手机上恢复为桌面版网站

c# - 如何在 C# 中将 HTML 设置为剪贴板?

javascript - 检查某些字符串(即使有空格)是否在数组中

html - webkit 浏览器不继承圆 Angular

jQuery 的 $.ajax URL 编码问题

web-applications - Golang Web 应用程序中的同步

jakarta-ee - 使用 WebRTC 的 Web 应用程序中的视频通话功能

python - python 网络应用程序中的自动注销

html - 如何生成随机标识?

ios - WKWebView 白屏(Objective-C)