jQuery Mobile 过渡效果

jQuery Mobile 拥有一系列关于如何从一页过渡到下一页的效果。前提是浏览器必须支持 CSS3 3D 转换:

浏览器支持

  • Internet Explorer 10 支持 3D 转换(更早的版本不支持)
  • Opera 仍然不支持 3D 转换

过渡效果可应用于任意链接或通过使用 data-transition 属性进行的表单提交:

下面的表格展示了可与 data-transition 属性一同使用的可用过渡:

 

jQuery Mobile 过渡效果

以上所有效果同时支持反向动作,例如,如果您希望页面从左向右滑动,而不是从右向左,请使用值为 "reverse" 的 data-direction 属性。在后退按钮上是默认的。

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>

</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>HEADER</h1>

        </div>

        

        <div data-role="content">

            <p>点击链接来查看滑动效果</p>

            <a href="#pagetwo" data-transition="slide">滑动到页面二</a>

        </div>

        

        <div data-role="footer">

            <h1>FOOTER</h1>

        </div>

    </div>

    

    

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

          <div data-role="header">

            <h1>我是一个对话框!</h1>

          </div>



      <div data-role="content">

        <p>点击链接来查看滑动效果</p>

        <a href="#pageone" data-transition="slide">滑动到页面一</a><!--加上该属性data-direction="reverse"  可以实现反向滑动-->

      </div>



      <div data-role="footer">

          <h1>页脚文本</h1>

      </div>

</div> 

</body>

</html>

 

你可能感兴趣的:(JQuery Mobile)