HTML5与JQuery.Mobile(六)
2012-09-18 10:55
288 查看
本小节的内容基本上与jQuery Mobile关系不大,主要是一些HTML5的知识:
input输入可以有多种type,并且我们在移动设备上可以有不同表现,例如点击电话号码输入框(type=tel)将弹出拨号输入框;而搜索框将显示搜索按钮和清除按钮:
对于checkbox,我们既可以单个使用,也可以分组使用:
对于单选按钮,基本用法同checkbox:
对于列表选择,用法如下:
input输入可以有多种type,并且我们在移动设备上可以有不同表现,例如点击电话号码输入框(type=tel)将弹出拨号输入框;而搜索框将显示搜索按钮和清除按钮:
<div data-role="fieldcontain"> <label for="username">姓名:</label> <input type="text" id="username"/> </div> <div data-role="fieldcontain"> <label for="tel">电话号码:</label> <input type="tel" id="tel"/> </div> <div data-role="fieldcontain"> <label for="email">email:</label> <input type="email" id="email"/> </div> <div data-role="fieldcontain"> <label for="website">网站:</label> <input type="url" id="website"/> </div> <div data-role="fieldcontain"> <label for="search">搜索:</label> <input type="search" id="search"/> </div>
对于checkbox,我们既可以单个使用,也可以分组使用:
<div data-role="controlgroup"> <div data-role="fieldcontain"> <legend>HTML5</legend> <label for="html5">是否喜欢HTML5</label> <input type="checkbox" id="html5"/> </div> </div> <div data-role="controlgroup"> <legend>兴趣爱好:</legend> <input type="checkbox" id="basketball"/> <label for="basketball">是否喜欢篮球</label> <input type="checkbox" id="football"/> <label for="football">是否喜欢足球</label> <input type="checkbox" id="pingpang"/> <label for="pingpang">是否喜欢乒乓球</label> </div>
对于单选按钮,基本用法同checkbox:
<div data-role="controlgroup" data-type="horizontal"> <legend>居住城市:</legend> <input type="radio" id="beijing" value="beijing" name="city" checked="true"/> <label for="beijing">北京</label> <input type="radio" id="shanghai" value="shanghai" name="city"/> <label for="shanghai">上海</label> <input type="radio" id="guangzhou" value="guangzhou" name="city"/> <label for="guangzhou">广州</label> </div>
对于列表选择,用法如下:
<div data-role="fieldcontain" > <label for="travel">选择旅游城市:</label> <select id="travel" name="travel"> <option value="tbeijing">北京</option> <option value="tshanghai">上海</option> <option value="tguangzhou">广州</option> </select> </div>
相关文章推荐
- HTML5与JQuery.Mobile(五)
- jquery mobile + html5 手机app表单跨域提交实例(手机app开发html5 juqery moblie phonegap系列一)
- Html5 + jquery mobile + mobiscroll ,REST手机客户端
- HTML5与JQuery.Mobile(三)
- HTML5, jQuery Mobile and ASP.NET MVC 4 – Using the ViewModel between the model and controller
- HTML5与JQuery.Mobile(四)
- HTML5与JQuery.Mobile(二)
- HTML5与JQuery.Mobile(一)
- jQuery Mobile + HTML5 获取地理位置信息
- HTML5 经量级框架 jQuery Mobile Bar(后退,多按钮,controlgroup,horizontal,导航条定义fixed,全屏模式) - 7.5
- HTML5结合jquery-mobile移动端的使用
- HTML5 经量级框架 jQuery Mobile List 列表 - 7.8
- 很早写的用HTML5 JQUERYMOBILE PHONEGAP来实现的手机照相
- html5的自定义data-*属性和jquery的data()方法的使用
- html5 学习 关于数据库的学习---言简意赅 jquery、html、css、web
- HTML5 jQuery+FormData 异步上传文件,带进度条
- html5的自定义data-*属性和jquery的data()方法的使用示例
- jQuery+HTML5美女瀑布流布局实现方法
- 初识phoneGap + dreamweaver5.5 + jQuery Mobile UI
- JQuery Mobile External Tool Bar ui-btn-active样式问题