zoukankan      html  css  js  c++  java
  • jQuery.mobile.activePage获取当点活动的page

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>jQuery.mobile.activePage demo</title>
      <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.9.1.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
      <style>
      #myResult {
        border: 1px solid;
        border-color: #108040;
        padding: 10px;
      }
      </style>
    </head>
    <body>
     
    <div data-role="page" id="page1">
      <div data-role="header">
        <h1>Page 1</h1>
      </div>
      <div data-role="content">
        <a href="#page2" data-role="button" data-inline="true">Go to Page 2</a>
        <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br>
        <div class="myResult">The result will be displayed here</div>
      </div>
    </div>
     
    <div data-role="page" id="page2">
      <div data-role="header">
        <h1>Page 2</h1>
      </div>
      <div data-role="content">
        <a href="#page1" data-role="button" data-inline="true">Go to Page 1</a>
        <input type="button" value="Which Page is this?" class="myButton" data-inline="true"/> <br>
        <div class="myResult">The result will be displayed here</div>
      </div>
    </div>
     
    <script>
    $(function() {
      $( ".myButton" ).on( "click", function() {
        var whichPageId = $.mobile.activePage.attr( "id" );
        $( ".myResult" ).html( "This is " + whichPageId );
      });
    });
    </script>
     
    </body>
    </html>
  • 相关阅读:
    IIS: 必须输入密码手动设置密码同步后
    IIS操作控制类
    SQL对IP地址进行拆分
    HTTP_REFERER的工作方式[转贴]
    如何知道同服务器上都有哪些网站?
    简单判断临时表是否存在
    .NET 3.5 SP 1发布了
    Log Parser很好很强大的IIS日志分析工具
    遍历Request.ServerVariables
    06复杂查询(多数据库表)
  • 原文地址:https://www.cnblogs.com/fumj/p/3471630.html
Copyright © 2011-2022 走看看