本文實例講解了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">繁
主站蜘蛛池模板:
临漳县|
中超|
巴林左旗|
四川省|
佳木斯市|
鄂托克前旗|
讷河市|
锡林郭勒盟|
佛坪县|
进贤县|
北海市|
甘肃省|
镇安县|
台南县|
右玉县|
沂南县|
苍山县|
广丰县|
崇州市|
乌拉特中旗|
日喀则市|
阿尔山市|
北安市|
张家川|
普兰县|
开封县|
河曲县|
吴川市|
蓬莱市|
洪洞县|
新安县|
崇州市|
阿克陶县|
凤台县|
汝阳县|
乌兰浩特市|
黄浦区|
鹤山市|
孝义市|
融水|
巩义市|