在《小强的HTML5移动开发之路(33)——
jqMobi基础 》中我们了解了什么是jqMobi,并从官方下载了jqMobi开发包,下载后解压目录如下:
拷贝上面的/css目录、/plugins目录、/ui目录、/appframework.js文件,如下图所示。
如果需要也可以拷贝index.html,然后自己修改,比如上面我的index01.html和index02.html
接下来引入css与js文件
<link href="css/af.ui.css" rel="stylesheet" type="text/css"/>
<link href="css/icons.css" rel="stylesheet" type="text/css"/>
<script src="appframework.js" type="text/javascript"></script>
<script src="ui/appframework.ui.js" type="text/javascript"></script>
index01.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jqMobi</title>
<link href="css/af.ui.css" rel="stylesheet" type="text/css"/>
<link href="css/icons.css" rel="stylesheet" type="text/css"/>
<script src="appframework.js" type="text/javascript"></script>
<script src="ui/appframework.ui.js" type="text/javascript"></script>
</head>
<body>
<p id="afui">
<p id="content">
<p id="home" title="首页" class="panel" selected="true"
data-footer="custom_footer">
</p>
<p id="about" title="关于我们" class="panel"
data-footer="custom_footer">
</p>
<header id="custom_header">
<h1>首页</h1>
</header>
<footer id="custom_footer">
<a href='#home' class='icon home'>首页</a>
<a href='#about' class='icon info'>关于我们</a>
</footer>
</p>
</p>
</body>
</html>
1、UI container
<p id="afui">
这里面是写的内容
</p>
<p id="afui"> <p id="content"> <!-- this is where your panels will go --> 这里写的是 panel </p>
</p>
<p id="afui">
<p id="content">
<p id="main" title="Welcome" class="panel" selected="true"> 在这个里面写我们的对应内容 </p>
</p>
</p>
(1)每个panel单独的header与footer
<p id="afui">
<p id="content">
<p id="main" title="Welcome" class="panel" selected="true">
<header>
<h1>Welcome</h1>
<a class="button" style="float:right;" class="icon home"></a>
</header> 对应页面的内容 <footer>
<a href='#about' class='icon info'>About</a>
</footer>
</p>
</p>
</p>
(2)公用的header和footer可以在多个panel中调用
<p id="afui"> <p id="content">
<p id="main" title="Welcome" class="panel" selected="true" data-footer="custom_footer" data-header="custom_header">对应页面的内容</p>
<header id="custom_header">
<h1>Welcome</h1>
<a class="button" style="float:right;" class="icon home"></a>
</header>
<footer id="custom_footer">
<a href='#about' class='icon info'>About</a>
</footer>
</p>
</p>
(3)另一种方法
<p id="header">
<!-- any additional HTML you want can go here -->
<a onclick="$.ui.toggleSideMenu();" class="button">Toggle Side Menu</a>
</p>
<p id="content">
<!-- this is where your panels will go -->
<p id="main" title="Welcome" class="panel" selected="true">
内容
</p>
<p id="about" title="About" class="panel" data-nav="second_nav">
<!-- by setting data-nav the "second_nav" will be shown on this panel -->
</p>
</p>
//底部
<p id="navbar">
<a target="#welcome" class="icon home">Home</a>
</p>
查看更多关于小强的HTML5移动开发之路(37)——jqMobi快速入门的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did65699
拷贝上面的/css目录、/plugins目录、/ui目录、/appframework.js文件,如下图所示。
如果需要也可以拷贝index.html,然后自己修改,比如上面我的index01.html和index02.html
接下来引入css与js文件
<link href="css/af.ui.css" rel="stylesheet" type="text/css"/> <link href="css/icons.css" rel="stylesheet" type="text/css"/> <script src="appframework.js" type="text/javascript"></script> <script src="ui/appframework.ui.js" type="text/javascript"></script>index01.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jqMobi</title> <link href="css/af.ui.css" rel="stylesheet" type="text/css"/> <link href="css/icons.css" rel="stylesheet" type="text/css"/> <script src="appframework.js" type="text/javascript"></script> <script src="ui/appframework.ui.js" type="text/javascript"></script> </head> <body> <p id="afui"> <p id="content"> <p id="home" title="首页" class="panel" selected="true" data-footer="custom_footer"> </p> <p id="about" title="关于我们" class="panel" data-footer="custom_footer"> </p> <header id="custom_header"> <h1>首页</h1> </header> <footer id="custom_footer"> <a href='#home' class='icon home'>首页</a> <a href='#about' class='icon info'>关于我们</a> </footer> </p> </p> </body> </html>1、UI container
<p id="afui"> 这里面是写的内容 </p>
<p id="afui"> <p id="content"> <!-- this is where your panels will go --> 这里写的是 panel </p> </p>
<p id="afui"> <p id="content"> <p id="main" title="Welcome" class="panel" selected="true"> 在这个里面写我们的对应内容 </p> </p> </p>(1)每个panel单独的header与footer
<p id="afui"> <p id="content"> <p id="main" title="Welcome" class="panel" selected="true"> <header> <h1>Welcome</h1> <a class="button" style="float:right;" class="icon home"></a> </header> 对应页面的内容 <footer> <a href='#about' class='icon info'>About</a> </footer> </p> </p> </p>(2)公用的header和footer可以在多个panel中调用
<p id="afui"> <p id="content"> <p id="main" title="Welcome" class="panel" selected="true" data-footer="custom_footer" data-header="custom_header">对应页面的内容</p> <header id="custom_header"> <h1>Welcome</h1> <a class="button" style="float:right;" class="icon home"></a> </header> <footer id="custom_footer"> <a href='#about' class='icon info'>About</a> </footer> </p> </p>(3)另一种方法
<p id="header"> <!-- any additional HTML you want can go here --> <a onclick="$.ui.toggleSideMenu();" class="button">Toggle Side Menu</a> </p> <p id="content"> <!-- this is where your panels will go --> <p id="main" title="Welcome" class="panel" selected="true"> 内容 </p> <p id="about" title="About" class="panel" data-nav="second_nav"> <!-- by setting data-nav the "second_nav" will be shown on this panel --> </p> </p> //底部 <p id="navbar"> <a target="#welcome" class="icon home">Home</a> </p>
查看更多关于小强的HTML5移动开发之路(37)——jqMobi快速入门的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did65699