同一級的位置添加一個header 標籤,並且id必須是header">
四、給對應的標籤定義title屬性,系統也會自動產生header
小強的HTML5行動開發之路(40)-jqMobi中實踐header定義的幾種方式
- 黄舟原創
- 2017-02-15 13:08:531834瀏覽
一、定義全域的header
這個header是所有panel預設的header,需要在
內部,也就是和
同一等級的位置加上一個header 標籤,且id必須是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"> <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>
二、panel引入標籤在內部。和
同一等級的位置頂一個header 標籤,並且命名id。 然後再需要這個header的pane添加一個屬性data-header="custom_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" 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>
三、給每個panel自定義header
在需要自定義的panel的內部定義一個header,這個header此時只屬於該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" 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>
四、給對應的標籤定義title屬性,系統也會自動產生header
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn