首页 > 代码库 > jquerymobile菜单事例

jquerymobile菜单事例

<!DOCTYPE html>
<html>
    <head>
        <title>三国</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0" /> 
        <script type="text/javascript" src=http://www.mamicode.com/"
http://code.jquery.com/jquery-1.5.min.js"></script>
        <link rel="stylesheet" href=http://www.mamicode.com/"
http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
        <script type="text/javascript" src=http://www.mamicode.com/"
http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="homepage" data-position="fixed">
            <div data-role="header">
                <h1>三国</h1>
            </div>
            <div data-role="content">
                <h4>三国时代</h4>
            </div>
            <div data-role="footer" data-position="fixed">
               <nav data-role="navbar">
                   <ul>
                      <li><a data-role="button" data-icon="forward" data-theme="a" href=http://www.mamicode.com/"#page_liu">蜀国
                      <li><a data-role="button" data-icon="forward" data-theme="a" href=http://www.mamicode.com/"#page_wu">吴国
                      <li><a data-role="button" data-icon="forward" data-theme="a" href=http://www.mamicode.com/"#page_cao">魏国
                   </ul>
               </nav>
            </div>
         </div>
         <div data-role="page" id="page_liu" data-position="fixed">
            <div data-role="header">
                <h1>蜀国</h1>
                <a data-role="button" data-icon="back" data-theme="a" href=http://www.mamicode.com/"#homepage">返回
            </div>
            <div data-role="content">
                刘备,关羽,张飞
            </div>
            <div data-role="footer" data-position="fixed">
                <h4>刘备的天下</h4>
            </div>
         </div>
         <div data-role="page" id="page_wu" data-position="fixed">
            <div data-role="header">
                <h1>吴国</h1>
                <a data-role="button" data-icon="back" data-theme="a" href=http://www.mamicode.com/"#homepage">返回
            </div>
            <div data-role="content">
              孙权,周瑜,黄盖
            </div>
            <div data-role="footer" data-position="fixed">
                <h4>孙权的天下</h4>
            </div>
         </div>
         <div data-role="page" id="page_cao" data-position="fixed">
            <div data-role="header">
                <h1>魏国</h1>
                <a data-role="button" data-icon="back" data-theme="a" href=http://www.mamicode.com/"#homepage">返回
            </div>
            <div data-role="content">
                曹操,曹仁,曹丕
            </div>
            <div data-role="footer" data-position="fixed">
                <h4>曹操的天下</h4>
            </div>
         </div>
     </body>
</html>

效果:

技术分享

 


jquerymobile菜单事例