jQuery Mobile Ö÷Ìâ
jQuery Mobile Ö÷Ìâ
jQuery Mobile ÌṩÁËÎåÖÖ²»Í¬µÄÑùʽÖ÷Ì⣬´Ó "a" µ½ "e" - ÿÖÖÖ÷Ìâ´øÓв»Í¬ÑÕÉ«µÄ°´Å¥¡¢À¸¡¢ÄÚÈݿ飬µÈµÈ¡£jQuery Mobile ÖеÄÒ»ÖÖÖ÷ÌâÓɶàÖֿɼûµÄЧ¹ûºÍÑÕÉ«¹¹³É¡£
ÈçÐè¶¨ÖÆÓ¦ÓóÌÐòµÄÍâ¹Û£¬ÇëʹÓà data-theme ÊôÐÔ£¬²¢Îª¸ÃÊôÐÔ·ÖÅäÒ»¸ö×Öĸ£º
<div data-role="page" data-theme="a|b|c|d|e"
>
Öµ | ÃèÊö | Àý×Ó |
---|---|---|
a | ĬÈÏ¡£ºÚÉ«±³¾°Éϵİ×É«Îı¾¡£ | ²âÊÔ |
b | À¶É«±³¾°Éϵİ×É«Îı¾ / »ÒÉ«±³¾°ÉϵĺÚÉ«Îı¾ | ²âÊÔ |
c | ÁÁ»ÒÉ«±³¾°ÉϵĺÚÉ«Îı¾ | ²âÊÔ |
d | °×É«±³¾°ÉϵĺÚÉ«Îı¾ | ²âÊÔ |
e | ³ÈÉ«±³¾°ÉϵĺÚÉ«Îı¾ | ²âÊÔ |
Ìáʾ£º»ìºÏÄúϲ»¶µÄÖ÷Ì⣡
ĬÈϵأ¬jQuery Mobile ΪҳüºÍÒ³½ÅʹÓà "a" Ö÷Ì⣬ΪҳüÄÚÈÝʹÓà "c" Ö÷Ì⣨ÁÁ»Ò£©¡£²»¹ý£¬ÄúÄܹ»×ÔÈçµØ¶ÔÖ÷Ìâ½øÐлìºÏ¡£
Ö÷Ì⻯µÄÒ³Ãæ¡¢ÄÚÈݺÍÒ³½Å
ʵÀý
<div data-role="header" data-theme="b"></div> <div data-role="content" data-theme="a"></div> <div data-role="footer" data-theme="e"></div>
Ö÷Ì⻯µÄ¶Ô»°¿ò
ʵÀý
<a href="#pagetwo" data-rel="dialog">Go To The Themed Dialog Page</a> <div data-role="page" id="pagetwo" data-overlay-theme="e"> <div data-role="header" data-theme="b"></div> <div data-role="content" data-theme="a"></div> <div data-role="footer" data-theme="c"></div> </div>
Ö÷Ì⻯µÄ°´Å¥
ʵÀý
<a href="#" data-role="button" data-theme="a">Button</a> <a href="#" data-role="button" data-theme="b">Button</a> <a href="#" data-role="button" data-theme="c">Button</a>
Ö÷Ì⻯µÄͼ±ê
ʵÀý
<a href="#" data-role="button" data-icon="plus" data-theme="e">Plus</a>
ҳüºÍÒ³½ÅÖеÄÖ÷Ì⻯°´Å¥
ʵÀý
<div data-role="header"> <a href="#" data-role="button" data-icon="home" data-theme="b">Home</a> <h1>Welcome To My Homepage</h1> <a href="#" data-role="button" data-icon="search" data-theme="e">Search</a> </div> <div data-role="footer"> <a href="#" data-role="button" data-theme="b" data-icon="plus">Button 1</a> <a href="#" data-role="button" data-theme="c" data-icon="plus">Button 2</a> <a href="#" data-role="button" data-theme="e" data-icon="plus">Button 3</a> </div>
Ö÷Ì⻯µÄµ¼º½À¸
ʵÀý
<div data-role="footer" data-theme="e"> <h1>Insert Footer Text Here</h1> <div data-role="navbar"> <ul> <li><a href="#" data-icon="home" data-theme="b">Button 1</a></li> <li><a href="#" data-icon="arrow-r">Button 2</a></li> <li><a href="#" data-icon="arrow-r">Button 3</a></li> <li><a href="#" data-icon="search" data-theme="a" >Button 4</a></li> </ul> </div> </div>
Ö÷Ì⻯µÄ¿ÉÕÛµþ°´Å¥ºÍÄÚÈÝ
ʵÀý
<div data-role="collapsible" data-theme="b" data-content-theme="e"> <h1>Click me - I'm collapsible!</h1> <p>I'm the expanded content.</p> </div>
Ö÷Ì⻯Áбí
ʵÀý
<ul data-role="listview" data-theme="e"> <li><a href="#">List Item</a></li> <li data-theme="a"><a href="#">List Item</a></li> <li data-theme="b"><a href="#">List Item</a></li> <li><a href="#">List Item</a></li> </ul>
Ö÷Ì⻯µÄ¿ÉÕÛµþÁбí
ʵÀý
<div data-role="collapsible" data-theme="b" data-content-theme="e"> <ul data-role="listview"> <li><a href="#">Agnes</a></li> </ul> </div>
Ö÷Ì⻯±íµ¥
ʵÀý
<label for="name">Full Name:</label> <input type="text" name="text" id="name" data-theme="a"> <label for="colors">Choose Favorite Color:</label> <select id="colors" name="colors" data-theme="b"> <option value="red">Red</option> <option value="green">Green</option> <option value="blue">Blue</option> </select>
Ö÷Ì⻯µÄ¿ÉÕÛµþ±íµ¥
ʵÀý
<fieldset data-role="collapsible" data-theme="b" data-content-theme="e"> <legend>Click me - I'm collapsible!</legend>
Ìí¼ÓÐÂÖ÷Ìâ
jQuery Mobile ͬʱÔÊÐíÄúÏòÒÆ¶¯Ò³ÃæÌí¼ÓÐÂÖ÷Ìâ¡£
Çëͨ¹ý±à¼ CSS Îļþ£¨ÈçÒÑÏÂÔØ jQuery Mobile£©À´Ìí¼Ó»ò±à¼ÐÂÖ÷Ìâ¡£Ö»Ð追±´Ò»¶ÎÑùʽ£¬²¢ÓÃ×ÖĸÃû£¨f-z£©À´¶ÔÀà½øÐÐÖØÃüÃû£¬È»ºóµ÷ÕûΪÄúϲ»¶µÄÑÕÉ«ºÍ×ÖÌå¼´¿É¡£
ÄúÒ²¿ÉÒÔͨ¹ýÔÚ HTML ÎĵµÖÐʹÓÃÖ÷ÌâÀàÀ´Ìí¼ÓÐÂÑùʽ - Ϊ¹¤¾ßÌõÌí¼ÓÀà ui-bar-(a-z)£¬²¢ÎªÄÚÈÝÌí¼ÓÀà ui-body-(a-z)£º
ʵÀý
<style> .ui-bar-f { color:green; background-color:yellow; } .ui-body-f { font-weight:bold; color:purple; } </style>