jquerymobile-17 搜索框、滑动按钮(Slider)、开关(Flip toggle switch)
来源:互联网 发布:php soap wsdl模式 编辑:程序博客网 时间:2024/04/28 23:55
今天介绍一下搜索框、滑动按钮(Slider)、开关(Flip toggle switch),我写的东西都是比较简单的,所以还需要读者认真的去研究官方的API。
首先给一个搜索框的代码:
<!DOCTYPE html><html><head><title>Form Example 8</title><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" /><script src="http://code.jquery.com/jquery-1.7.1.min.js"></script><script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script></head><body><div data-role="page"><div data-role="header"><h1>Form Demo</h1></div><div data-role="content"><form action="echo.cfm" method="post"><div data-role="fieldcontain"> <label for="name">姓名:</label> <input type="search" name="name" id="name" value="" /></div><div data-role="fieldcontain"> <input type="submit" name="submit" value="搜索" /></div></form></div></div></body></html>
效果如下:
搜索框中默认为空,也没有后面的×号。当我们输入内容的时候会自动出现。
然后看一段滑动按钮(Slider)的代码:
<!DOCTYPE html><html><head><title>Form Example 10</title><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" /><script src="http://code.jquery.com/jquery-1.7.1.min.js"></script><script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script></head><body><div data-role="page"><div data-role="header"><h1>Form Demo</h1></div><div data-role="content"><form action="echo.cfm" method="post"><div data-role="fieldcontain"> <label for="coolness">音量:</label><input type="range" name="coolness" id="coolness" min="0" max="100" value="22" data-highlight="true"></div><div data-role="fieldcontain"> <input type="submit" name="submit" value="Send" /></div></form></div></div></body></html>
效果如下:
代码中min、max、value相信大家都可以看懂。默认的情况每滑动一下变化为1,我们可以为其添加step属性,其值为你想改变的数。
下面给出一个开关(Flip toggle switch)的代码:
<!DOCTYPE html><html><head><title>Form Example 9</title><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" /><script src="http://code.jquery.com/jquery-1.7.1.min.js"></script><script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script><style>div.ui-slider-switch { width: 9em }</style></head><body><div data-role="page"><div data-role="header"><h1>Form Demo</h1></div><div data-role="content"><form action="echo.cfm" method="post"><div data-role="fieldcontain"> <label for="gender">性别:</label><select name="gender" id="gender" data-role="slider" ><option value="0">男</option><option value="1">女</option></select></div><div data-role="fieldcontain"> <input type="submit" name="submit" value="Send" /></div></form></div></div></body></html>
如果想学习更多还请多看看官方的DEMO。
- jquerymobile-17 搜索框、滑动按钮(Slider)、开关(Flip toggle switch)
- jquerymobile-7 表单基础 radio buttons和checkboxes select menu 搜索框、滑动按钮(Slider)、开关(Flip toggle switch)
- Toggle Buttons(开关按钮)
- iOS的settings bundle中开关按钮(Toggle Switch)取不到值的问题
- UI课程(1.Control,2.Switch开关 ,3.slider滑动器,4.SegmentedControl分段)
- 自定义Switch滑动开关
- 自定义 Switch 开关按钮
- 开关按钮Switch
- switch开关按钮
- 常用控件 06 开关按钮 Toggle Buttons
- Toggle Buttons(SwitchButton),开关按钮
- qt 可开关的toggle按钮
- 滑动开关按钮SlideSwich
- android滑动开关按钮
- Android 滑动开关按钮
- html滑动开关按钮
- 滑动开关按钮
- 开关按钮ToggleButton与Switch
- 贪食蛇
- JDBC插入Oracle数据库有主键的X表记录时,获取此记录的主键ID。
- 完成端口
- 判断链表相交【转载】
- 正则注释
- jquerymobile-17 搜索框、滑动按钮(Slider)、开关(Flip toggle switch)
- POJ 3275
- Js、Jquery的复制剪贴板操作
- 拒绝平庸,我要努力!
- 工蚁正传①
- 快捷键大全
- Python学习笔记:异常
- 基本的排序算法
- jquery live()重复绑定的解决办法