詳解jQuery Mobile自訂標籤,jquerymobile
本文執行個體講解了jQuery Mobile自訂標籤,分享給大家供大家參考,具體內容如下
規劃產品國際化的需求時,涉及到PC Web,移動Web,和各app。設計了多個版本的移動Web均不理想。
由於移動Web採用了jQuery Mobile架構,所以將切換語言放在哪個位置更合理進行了討論。討論的過程和多個方案我就不提了,先來看看最終效果:
是不是感覺很經驗,這裡一開始嘗試了多次,最終自訂了一個下拉選項,代碼如下:
<!DOCTYPE html> <html> <head> <title>jQuery Mobile</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache, must-revalidate"> <meta http-equiv="Cache" content="no-cache"> <link rel="stylesheet" href="jQuery/jquery.mobile-1.4.4.min.css" type="text/css"> <script type="text/javascript" src="jQuery/jquery-1.8.3.min.js"></script> <script type="text/javascript" src="jQuery/jquery.mobile-1.4.4.min.js"></script> <script type="text/javascript" src="jQuery/jquery.cookie.js"></script> <script type="text/javascript" src="jQuery/jquery.i18n.properties-min-1.0.9.js"></script> <style type="text/css"> .comFooter{ position: absolute; bottom: 0; left:0; height: 40px; width: 100%; } </style> </head> <body> <div data-role="page" id="pageWel" data-title="指令碼"> <div data-role="header" data-theme="b"> <a href="#" data-role="button" class="ui-btn-left" data-icon="check">測試</a> <h1 class="title" data-i18n="global_title"> 幫客之家 </h1> <!-- 具體代碼 --> <a href="javascript:void(0);" data-role="none" aria-haspopup="true" class="ui-btn-right"> <select class="hupu_i18n_select" data-icon="check" data-role="button" data-inline="false" data-native-menu="false"> <option value="zh-CN">簡體中文</option> <option value="zh-TW">繁體中文</option> <option value="en">English</option> <option value="ja">日本語の</option> </select> </a> </div> <div role="main" class="ui-content"> 歡迎大家關注幫客之家 </div> <div data-role="footer" data-theme="b" class="comFooter"> <span style="height: 40px; line-height: 40px; text-align: center; display: block; font-size: 9px;">1213456</span> </div> </div> </body> </html>
以上就是關於 jQuery Mobile自訂標籤的相關介紹,希望對大家瞭解jQuery Mobile自訂標籤有所協助。
您可能感興趣的文章:
- Jquery外掛程式之打造自訂的select標籤
- 基於jQuery的擷取標籤名的代碼
- jquery如何改變html標籤的樣式(兩種實現方法)
- Jquery為a標籤的href賦值實現代碼
- jquery通過visible來判斷標籤是否顯示或隱藏
- Jquery 擷取指定標籤的對象及屬性的設定與移除
- jquery 為a標籤綁定click事件範例程式碼
- jQuery標籤替換函數replaceWith()的使用例子
- jQuery使用load()方法載入另外一個網頁檔案內的指定標籤內容到div標籤的方法
- jQuery擷取標籤常值內容和html內容的方法