這兩天看了《PhoneGap實戰》上面有一個匯率計算器的例子,個人覺得比較好,就拿出來和大家分享一下,在接下來的幾篇文章中我們來一起完成這個PhoneGap + Jquery mobile的小練習。
一、在DrameWeaver中新建站點,如圖:
一、在DrameWeaver中新建站點,如圖:
二、編寫匯率計算頁
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> <!--引入相关样式框架--> <link rel="stylesheet" href="css/jquery.mobile-1.0.1.min.css"/> <script src="js/jquery.js"></script> <script src="js/jquery.mobile-1.0.1.min.js"></script> </head> <body> <p data-role="page" id="index"> <p class="exchangeRates"> <p class="header"> <p class="right"> <p class="right"> <a href="#setting" data-transition="slide"><img src="images/tm.gif" width="80" height="89" border="0"></a> </p> </p> </p> <p class="bg"> <p class="list"> <p class="currency">人民币</p> <p class="money"><input type="number" id="c1" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">美元</p> <p class="money strong"><input type="number" id="c2" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">日元</p> <p class="money strong"><input type="number" id="c3" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">里尔</p> <p class="money strong"><input type="number" id="c4" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">新加坡元</p> <p class="money strong"><input type="number" id="c5" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">欧元</p> <p class="money strong"><input type="number" id="c6" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">克朗</p> <p class="money strong"><input type="number" id="c7" maxlength="12" value="0"/></p> </p> <p class="list"> <p class="currency">英镑</p> <p class="money strong"><input type="number" id="c8" maxlength="12" value="0"/></p> </p> </p> </p> <p data-role="page" id="setting"> <p class="setRates"> </p> </p> </body> </html>
樣式檔:
<link rel="stylesheet" href="css/style.css"/>
/* CSS Document */ body{ background-color:#c19e7d; font-family:"黑体"; margin:0px; padding:0px; } /* 1.text-align:center 设置文本或img标签等一些内联对象(或与之类似的元素)的居中。 2.margin:0 auto 设置块元素(或与之类似的元素)的居中。 */ .exchangeRates,.setRates{ width:480px; height:100%; margin:0 auto; font-family:"黑体"; } .header{ width:480px; height:116px; background:url(../images/title.png) no-repeat; } .header .right{ float:right; width:80px; height:54px; } .header .right a{ float:right; width:80px; height:54px; } .header .right a:hover{ float:left; width:80px; height:54px; background:url(../images/setting.png) no-repeat; }
添加列表樣式匯率計算器【1】的內容,更多相關內容請關注PHP中文網(www.php.cn)!