这次给大家带来jquery mobile自定义标签使用详解,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>
<p data-role="page" id="pagewel" data-title="脚本">
<p 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>
</p>
<p role="main" class="ui-content">
欢迎大家关注脚本之家
</p>
<p 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>
</p>
</p>
</body>
</html>
相信看了本文案例你已经掌握了方法,更多精彩请关注其它相关文章!
推荐阅读:
jquery实现跨域异步上传文件步骤详解
mobile框架开发移动端web app步骤详解
以上就是jquery mobile自定义标签使用详解的详细内容。
