<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>demo</title>
    <link rel="stylesheet" href="jquery.mobile-1.3.2.min.css" />
    <script type="text/javascript" src="jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="jquery.mobile-1.3.2.min.js"></script>
    <script type="text/javascript" src="jquery.ui.effect.min.js"></script>
    <style type="text/css">
        * { font-family: 'Microsoft YaHei'; }
        body, html { width: 100%; }
        div .asdd div { }
        .one { left: 0%; }
        .two { left: 25%; }
        .three { left: 50%; }
        .four { left: 75%; }
        #ul-one, #ul-two, #ul-three, #ul-four { position: relative; }
        #ul-one { left: 0%; }
        #ul-two { left: 100%; display: none; }
        #ul-three { left: 100%; display: none; }
        #ul-four { left: 100%; display: none; }
        .ul-active { display: block; }
        #touch-box { width: 100%; }
        .ul-style { list-style: none; margin-top: 0px; padding-left: 0px; }
            .ul-style > li { width: 100%; background: -webkit-linear-gradient(top,#f1f1f1,#fdfdfd); padding: 5px; background: -moz-linear-gradient(top,#f1f1f1,#fdfdfd); background: -o-linear-gradient(top,#fff,#fdfdfd); border-top: 1px solid #ccc; padding: 3px; }
            .ul-style :last-child { border-bottom: 1px solid #ccc; padding: 3px; }
            .ul-style li > a { text-decoration: none; margin: 1%; }
    </style>
    <script type="text/javascript">
        $(function () {
            var arr = ["#firsta a", "#seconda a", "#thirda a", "#fortha a"], arry = 0, ularr = ["#ul-one", "#ul-two", "#ul-three", "#ul-four"];
            $(document)
            .bind("swiperight", function () { $(".ui-btn-active").removeClass("ui-btn-active"); arry++; if (arry > 3) arry = 0; $(arr[arry]).addClass("ui-btn-active"); $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": arry * 25 + "%" }, "easeOutQuint"); $(ularr[arry]).show().addClass("ul-active").animate({ "left": "0%" }, 300); })
            .bind("swipeleft", function () { $(".ui-btn-active").removeClass("ui-btn-active"); arry--; if (arry < 0) arry = 3; $(arr[arry]).addClass("ui-btn-active"); $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": arry * 25 + "%" }, "easeOutQuint"); $(ularr[arry]).show().addClass("ul-active").animate({ "left": "0%" }, 300); });
            $("#firsta").click(function () { $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": "0%" }, "easeOutQuint"); $("#ul-one").show().addClass("ul-active").animate({ "left": "0%" }, 300); });
            $("#seconda").click(function () { $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": "25%" }, "easeOutQuint"); $("#ul-two").show().addClass("ul-active").animate({ "left": "0%" }, 300); });
            $("#thirda").click(function () { $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": "50%" }, "easeOutQuint"); $("#ul-three").show().addClass("ul-active").animate({ "left": "0%" }, 300); });
            $("#fortha").click(function () { $(".ul-active").removeClass("ul-active").animate({ "left": "-100%" }, 300).hide(); $("#box").animate({ "left": "75%" }, "easeOutQuint"); $("#ul-four").show().addClass("ul-active").animate({ "left": "0%" }, 300); });
        })
    </script>
</head>
<body>
    <div id="touch-box">
        <div data-role="navbar" data-grid="c">
            <ul>
                <li id="firsta"><a href="#" class="ui-btn-active">新闻</a></li>
                <li id="seconda"><a href="#">娱乐</a></li>
                <li id="thirda"><a href="#">大事</a></li>
                <li id="fortha"><a href="#">小事</a></li>
            </ul>
            <div class="asdd">
                <div style="width: 25%; height: 20px; background-color: #f00; position: relative;" id="box"></div>
            </div>
        </div>
        <ul id="ul-one" class="ul-active ul-style">
            <li><a href="#" style="color: #333">Acura</a></li>
            <li><a href="#" style="color: #333">Audi</a></li>
            <li><a href="#" style="color: #333">BMW</a></li>
            <li><a href="#" style="color: #333">Cadillac</a></li>
            <li><a href="#" style="color: #333">Ferrari</a></li>
        </ul>
        <ul id="ul-two" class="ul-style">
            <li><a href="#" style="color: #333">sd</a></li>
            <li><a href="#" style="color: #333">sd</a></li>
            <li><a href="#" style="color: #333">sd</a></li>
            <li><a href="#" style="color: #333">sdc</a></li>
            <li><a href="#" style="color: #333">sdi</a></li>
        </ul>
        <ul id="ul-three" class="ul-style">
            <li><a href="#" style="color: #333">df</a></li>
            <li><a href="#" style="color: #333">df</a></li>
            <li><a href="#" style="color: #333">df</a></li>
            <li><a href="#" style="color: #333">df</a></li>
            <li><a href="#" style="color: #333">df</a></li>
        </ul>
        <ul id="ul-four" class="ul-style">
            <li><a href="#" style="color: #333">we</a></li>
            <li><a href="#" style="color: #333">we</a></li>
            <li><a href="#" style="color: #333">df</a></li>
            <li><a href="#" style="color: #333">ewc</a></li>
            <li><a href="#" style="color: #333">wei</a></li>
        </ul>
    </div>
</body>
</html>

jquery mobile touch 实例的更多相关文章

  1. jquery mobile Touch事件

    Touch事件在用户触摸屏幕(页面)时触发 1.jquery mobile tap tap事件在用户敲击某个元素时触发 $("p").on("tap",fucn ...

  2. jQuery Mobile和Sencha Touch哪个更适合你?

    纯粹的总结一下移动web开发框架,移动web开发框架有jQuery Mobile .Sencha Touch等等,他们都来源于web开发,是成熟的框架,jQuery Mobile出自于jQuery家族 ...

  3. (转)Sencha Touch和jQuery Mobile的比较

    原文:http://extjs.org.cn/node/664 Sencha Touch和jQuery Mobile的比较 Posted 周三, 08/07/2013 - 10:07 by admin ...

  4. Sencha Touch 和 jQuery Mobile 的比较

    Sencha Touch 和 jQuery Mobile 的比较 英文原文:Sencha Touch vs jQuery Mobile 标签: Sencha Touch jQuery Mobile 1 ...

  5. jquery mobile自己定义webapp开发实例(一)——前言篇

    用jquery mobile做了一段时间的webapp开发,准备用自己的一个小demo做一个模块化的分享 点击demo演示 手机演示二维码: 此demo已经是比較老的版本号,用户体验流畅度确实还存在非 ...

  6. 移动Web框架:jQuery Mobile VS Sencha Touch

    最近常被问到是用 jQuery Mobile还是Sencha Touch,本人也比较关注这两个框架,试图从以下两方面发表点儿见解: 身家背景,都系出名门 1.jQuery Mobile 建立在jQue ...

  7. Sencha Touch vs jQuery Mobile

    Sencha Touch:重量级框架,类似于Flex SDK;组件封装较多;在各平台交互表现统一(内部封装);入门门槛较高 jQuery Mobile:轻量级框架,实质是jQuery插件;组件较少;交 ...

  8. Sencha Touch和jQuery Mobile的比较

    第一组-行销和平台支持 Sencha Touch和jQuery Mobile都以HTML5框架著称.jQuery Mobile谦虚的说自己只是内建于所有流行的移动设备平台,而Sencha Touch则 ...

  9. Jquery Mobile实例--利用优酷JSON接口读取视频数据

    本文将介绍,如何利用JqueryMobile调用优酷API JSON接口显示视频数据. (1)注册用户接口. 首页,到 http://open.youku.com 注册一个账户,并通过验证.然后找到A ...

随机推荐

  1. .NET MVC 插件化框架支持原生MVC的Area和路由特性

    前面开放的源码只是简单的Plugin的实现,支持了插件的热插拔,最近晚上偶然想到,原生的MVC提供Areas和RouteAtrribute等路由特性标签,按照先前的做法,无法解析插件的路由特性和Are ...

  2. 生产环境下Centos 6.5优化配置 (装载)

    本文 centos 6.5 优化 的项有18处: 1.centos6.5最小化安装后启动网卡 2.ifconfig查询IP进行SSH链接 3.更新系统源并且升级系统 4.系统时间更新和设定定时任 5. ...

  3. Express 学习记录

    1. Express 4.0以上的版本需要独立安装 the express "generator",即 npm install -g express-generator.

  4. Android Timer的使用

    1:服务端使用PHP <?php echo date('Y-m-d H:i:s'); ?> 2:activity_main.xml <RelativeLayout xmlns:and ...

  5. LeetCode_Decode Ways

    A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' - ...

  6. sybase 备份和恢复

    use master go dump transaction MBFEWKDB with no_log go dump transaction MBFEHISDB with no_log go use ...

  7. 【HDOJ】1497 Simple Library Management System

    链表. #include <cstdio> #include <cstring> #include <cstdlib> #define MAXM 1001 #def ...

  8. oschina服务器软件

    服务器软件 74Apache模块 54Nginx扩展模块 13Radius相关 94PaaS 系统 29服务发现/注册和协调 17Docker 扩展 7Docker 映像 83应用服务器 189HTT ...

  9. Activity — 4 launch mode

    launchMode在多个Activity跳转的过程中扮演着重要的角色,它可以决定是否生成新的Activity实例,是否重用已存在的Activity实例,是否和其他Activity实例公用一个task ...

  10. 带’*’号字符串的匹配

    目标: 判断源字符串中是否含有指定子串,子串可能会有*号通配符. 初步测试没问题.记录下来.后面要是有问题再来纠正. #include <string> using namespace s ...