jQueryMobileã触ã£ã¦ã¿ãã®ã§ã¡ã¢ã
jQueryMobileã¯ã¹ãã¼ããã©ã³ãã¿ãã¬ããã«ç¹åããJavascript Frameworkã
æºå
downloadãã¼ã¸ããjQueryMobileæ¬ä½ã¨cssããã¦ã³ãã¼ããã¦ããã
http://jquerymobile.com/download/
ãã¹ãã£ã³ã°ããã¦ããã¿ããã ãã©ãä»åã¯jQueryMobileã§æä¾ããããã¶ã¤ã³ãã¼ãã§å©ç¨ãããç»åãã¹ãã¢ããªå´ã¨åããªãã£ãçºzipããã¦ã³ãã¼ãããã
ãã¦ã³ãã¼ããããã¡ã¤ã«ãå±éããã¨js,css,imagesãå
¥ã£ã¦ããã
cssã¯jQueryMobileãè¦ç´ ã®å±æ§ãå¤æãã¦ã¬ã¤ã¢ã¦ããæ´ããã®ã«ä½¿ãããã
ãããã¨åããã¦jQueryæ¬ä½ãèªã¿è¾¼ãã
ãã£ã¦ãã¼ãããé çªã¯ä»¥ä¸ã®ããã«ãªãã
<link href="/stylesheets/jquery.mobile-1.0a2.min.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="/javascripts/jquery.mobile-1.0a2.min.js" type="text/javascript"></script>
以ä¸ã§æºåã¯å®äºã
è¦ç´ ã®è¨è¿°
å®éã«jQueryMobileãæ´»ç¨ãã¦ã¹ããåãviewãæ§ç¯ãã¦ããã
ã¾ãã¡ã¤ã³ã®ã³ã³ãã³ãã¨ãªãé¨åã以ä¸ã®å±æ§ãã¤ãã¦è¨è¿°ããã
<div data-role="page" data-theme="d"> </div>
data-role="page"ã¯ã¡ã¤ã³ã®ã³ã³ãã³ãã§ãããã¨ã示ãå±æ§ã
data-theme="d"ã¯é©ç¨ãããã¶ã¤ã³ãã¼ã*1ã®ç¨®é¡ãæå®ããçºã®å±æ§ã
次ã«ãããè¦ç´ ã®è¨è¿°ã
<div data-role="header"> header </div>
ããã§ããããã表ãdata-role="header"ãæå®ãããã¨ã§ãããã¬ã¤ã¢ã¦ããé©ç¨ãããã
ãªã¹ãè¦ç´ ã®è¨è¿°ã
<ul data-role="listview" data-theme="c" data-inset="true"> <li> <a href="/vocabulary/new">add word</a> </li> <li> <a href="/dashboard/index">dashboard</a> </li> <li> <a href="/mobile/list">list</a> </li> <li> <a href="/dashboard/examination">examination</a> </li> </ul>
ããã¾ã§ããã¨å±æ§ã«ã¤ãã¦ã¯å¤§ä½äºæ³ã§ããã§ããããã
data-role="listview"ã§ãªã¹ãæ§é ãåããã¨ãæå®ããã
data-theme="c"ã§ãªã¹ãã®ãã¶ã¤ã³ãã¼ã*2ãé©ç¨ã
data-inset="true"ãæå®ãããã¨ã«ãã£ã¦ä¸æ¬ãã®ãã¼ã¿ã»ããã¨ãããå
¨ä½ãè§ä¸¸ã¬ã¤ã¢ã¦ãããã模æ§ã(詳細æªç¢ºèª
éä¸ã«ä¸è¨ä»¥å¤ã®è¦ç´ ãå
¥ã£ã¦ãããã以ä¸ãã¬ã³ããªã³ã°ãããã¨ä»¥ä¸ã®ãããªã¬ã¤ã¢ã¦ãã«ãªãã
ãªã³ã¯ã«ã¤ãã¦
jQueryMobileã«ããã¦ãªã³ã¯(aã¿ã°)ã¯å
¨ã¦Ajaxã«ãããªã¯ã¨ã¹ãã¨ãªãã*3
ããã«ãããã¼ã¸é·ç§»ãªãã«iOSã®ãã¤ãã£ãã¢ããªã®æ§ãªãã¼ã¸é·ç§»ãè¡ããã¨ãã§ããã
ã¤ã¡ã¼ã¸ã«ã¤ãã¦ã¯jQueryMobileデモãåç
§ã
ãªã³ã¯å
ã®ãã¼ã¸ã«ã¤ãã¦ã¯ç¹ã«Ajaxãªã¯ã¨ã¹ãã§ãããã¨ãæèããå¿
è¦ã¯ãªãã
å¾æ¥éãã®HTMLã§ãjQueryMobileã®ã¬ã¤ã¢ã¦ããè¨è¿°ããHTMLãè¿ãã ãã§è¯ãã
ä¾ï¼
<!DOCTYPE html> <html> <head> <title>title</title> <link href="/stylesheets/jquery.mobile-1.0a2.min.css" media="screen" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script src="/javascripts/jquery.mobile-1.0a2.min.js" type="text/javascript"></script> </head> <body> <div data-role="page" data-theme="d"> <div data-role="header"> <h1>Word List</h1> </div> <div style="margin:0 3px;"> <ul data-role="listview" data-theme="c" data-inset="true"> <li> <a href="/vocabulary/show/1">word</a> </li> <li> <a href="/vocabulary/show/2">duplicate</a> </li> <li> <a href="/vocabulary/show/3">disrupt</a> </li> <li> <a href="/vocabulary/show/4">rupt</a> </li> <li> <a href="/vocabulary/show/5">annual</a> </li> <li> <a href="/vocabulary/show/6">fundamental</a> </li> <li> <a href="/vocabulary/show/7">ensure</a> </li> <li> <a href="/vocabulary/show/8">add</a> </li> </ul> </div> </div> </body> </html>
jQueryMobileã¯ãã®ã¬ã¹ãã³ã¹ããã¼ããã¦ä»¥ä¸ã®æ§ã«ã¬ã¤ã¢ã¦ããæ´ããã
ãã®æ§ã«èªåã§backãã¿ã³ãä»ããããããããå©ç¨ãã¦ãã¼ã¸é·ç§»ãããã¨ãªãå
ã®ãã¼ã¸ã«æ»ããã¨ãã§ããã
ã¾ã¨ã
jQueryMobileã¯ã¹ãã¼ããã©ã³åãã®ãã¼ã¸ãç´ æ©ãç°¡åã«æ§ç¯ãããã¨ãã§ãã¾ãã
èªåã§å®è£
ããã¨é¢åãªç¡é·ç§»ã®ãã¼ã¸ç§»åãç°¡åã«å®è£
ã§ãã¾ãã
ã¾ããã¶ã¤ã³ãjQueryMobileå´ã§å¸åãã¦ããã¦ããã®ã§å¤§éã®cssãæ¸ããã«æ¸ã¿ã¾ãã
ãã以å¤ã«ãããããæ©è½ãæä¾ããã¦ããã®ã§é常ã«æç¨ãªãã¬ã¼ã ã¯ã¼ã¯ã§ããã¨æãã¾ãã
ç¹ã«ã¤ãã³ãé¢é£ã®å
å®ã¯æ¬å½ã«ç´ æ´ãããã§ãã
ããã§ãã¶ã¤ã³ãã¼ããç°¡åã«è¨è¿°ã§ããããã«ãªãã¨ãã£ã¨è¯ããã®ã«ãªãã¨æãã¾ããã