, and the id must be header.">
Home > Article > Web Front-end > Xiaoqiang’s road to HTML5 mobile development (40) - several ways to practice header definition in jqMobi
Xiaoqiang’s road to HTML5 mobile development (40) - several ways to practice header definition in jqMobi
- 黄舟Original
- 2017-02-15 13:08:531790browse
1. Define the global header
This header is the default header for all panels and needs to be inside 4d3cdd0d6096fc7d10c3f51eabfb6ad0, that is, with
For example:
<!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"> <header id="header"> <a id="backButton" href="javascript:;" class="button" >Back</a> <h1>Single Page App</h1> </header> <p id="content"> <p id="home"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </p> <p id="sketch"> <p>sketch</p> </p> </p> <p id="navbar"> <a href="#home" id='navbar_home' class='icon home'>home</a> <a href="#sketch" id='navbar_pencil' class='icon pencil'>Sketch</a> <a href="#picture" id='navbar_picture' class='icon picture'>Picture</a> </p> </p> </body> </html>
Running effect
2. Introduce the header tag into the panel
<!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" data-header="custom_header"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </p> <p id="sketch"> <p>sketch</p> </p> </p> <header id="custom_header"> <a id="backButton" href="javascript:;" class="button" >Back</a> <h1>Single Page App</h1> </header> <p id="navbar"> <a href="#home" id='navbar_home' class='icon home'>home</a> <a href="#sketch" id='navbar_pencil' class='icon pencil'>Sketch</a> <a href="#picture" id='navbar_picture' class='icon picture'>Picture</a> </p> </p> </body> </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" class="panel"> <header> <a id="backButton" href="javascript:;" class="button" >Back</a> <h1>Single Page App</h1> </header> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </p> <p id="sketch"> <p>sketch</p> </p> </p> <p id="navbar"> <a href="#home" id='navbar_home' class='icon home'>home</a> <a href="#sketch" id='navbar_pencil' class='icon pencil'>Sketch</a> <a href="#picture" id='navbar_picture' class='icon picture'>Picture</a> </p> </p> </body> </html>4. Give the corresponding The tag defines the title attribute, and the system will automatically generate the header
<!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> <nav> <p class='title'>Home</p> <ul> <li><a class="icon home mini" href="#main">Home</a></li> </ul> </nav> </p> </p> </body> </html>
The above is Xiaoqiang’s The road to HTML5 mobile development (40) - several ways to practice header definition in jqMobi. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!
#
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Xiaoqiang’s road to HTML5 mobile development (39) - jqMobi plug-in json format ActionSheetNext article:Xiaoqiang’s road to HTML5 mobile development (39) - jqMobi plug-in json format ActionSheet
Related articles
See more- AlloyTouch full-screen scrolling plug-in creates a smooth H5 page in 30 seconds
- HTML5 actual combat and analysis of touch events (touchstart, touchmove and touchend)
- Detailed explanation of image drawing examples in HTML5 canvas 9
- Regular expressions and new HTML5 elements
- How to combine NodeJS and HTML5 to drag and drop multiple files to upload to the server