jQuery Mobile 教程:页面切换动画

 时间:2026-02-16 10:42:00

1、<!DOCTYPE html>

<html>

<head>

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">

<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>

<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>

</head>

<body>

<div data-role="page" id="pageone">

  <div data-role="header">

    <h1>欢迎访问我的主页</h1>

  </div>

  <div data-role="content">

    点击链接来查看弹窗效果。

    <a href="#pagetwo" data-transition="pop">转到页面二</a>

  </div>

  <div data-role="footer">

    <h1>页脚文本</h1>

  </div>

</div> 

<div data-role="page" id="pagetwo">

  <div data-role="header">

    <h1>欢迎访问我的主页</h1>

  </div>茄孝

  <div data-role="content">

    点击链接距国返回页面一。<b>注释:</b>:fade 是默认效果。

    <a href="#pageone">返回页面一</a>

  </div>

  <div data-role="footer">

    <h1>页脚文本</h1>兼总温

  </div>

</div> 

</body>

</html>

2、代码中 data-transition="pop"  表示页面过渡,值为pop,也就是弹窗效果

jQuery Mobile 教程:页面切换动画

3、将data-transition值更改可以改变过渡效果,下面是对应效果的值

fade:淡入淡出效果

flip  :翻页效果

flow:流效果

pop :弹窗效果

slide:滑动效果

slidefade:滑动淡出效果

slideup:上滑动效果

slidedown:下滑动效果

turn:翻页效果

none:无过度动画

reverse:反向

  • jQuery Mobile教程: 网格
  • jquery跳转页面的方法
  • jQuery Mobile全攻略
  • jQuery Mobile 教程:按钮图标
  • 怎样为Jquery Mobile的页面添加按钮图标
  • 热门搜索
    红牛喝多了会怎么样 炒辣子鸡的家常做法 养生方法 鼻头缩小方法 排肚子里的气最快方法 栗子鸡的做法大全家常 肝癌治疗方法 芥菜丝的腌制方法大全 左肩膀疼是怎么回事 宝宝断奶的最佳方法