jQueryMobile的组件——复选框(checkbox)和单选钮(radio)

jQueryMobile框架为原生的html表单元素封装了新的表现形式,对触屏设备的操作进行了优化。

data-theme="b"——指明元素的主题为黑色主题;

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>checkbox&radio实例</title>
    <script src="jquery-2.1.3.min.js"></script>
    <script src="jquery.mobile-1.4.5.min.js"></script>
    <link rel="stylesheet" href="jquery.mobile-1.4.5.min.css" type="text/css">
</head>
<body>
<div data-role="page">
    <div data-role="header" data-position="fixed">
        <h1>欢迎来到主页</h1>
    </div>
    <div data-role="content" >
        <label>
            <input type="checkbox">苹果
        </label>
        <fieldset data-role="controlgroup">
            <label>
                <input type="checkbox" name="cb0">苹果
            </label>
            <label>
                <input type="checkbox" name="cb0">香蕉
            </label>
            <label>
                <input type="checkbox" name="cb0">橘子
            </label>
        </fieldset>

        <fieldset data-role="controlgroup" data-type="horizontal">
            <label>
                <input type="checkbox" name="cb0">苹果
            </label>
            <label>
                <input type="checkbox" name="cb0" data-theme="b">香蕉
            </label>
            <label>
                <input type="checkbox" name="cb0">橘子
            </label>
        </fieldset>

        <fieldset data-role="controlgroup" data-type="horizontal">
            <label>
                <input type="radio" name="r1" id="male">男
            </label>
            <label>
                <input type="radio" name="r1" id="female" >女
            </label>
        </fieldset>
    </div>
    <div data-role="footer" data-position="fixed">
        <h1>这是底部</h1>
    </div>
</div>
</body>
</html>

在iPhone6中的效果:

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-08-28 01:40:20

jQueryMobile的组件——复选框(checkbox)和单选钮(radio)的相关文章

bootstrap-表单控件——复选框checkbox和单选择按钮radio

1.运行效果如图所示 2.实现代码如下 <!DOCTYPE html> <html> <head>     <meta charset="utf-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <title>表单控件--复选框checkbox和单选择按钮radio</title>

Bootstrap系列 -- 17. 复选框checkbox和单选择按钮radio

Bootstrap框架中checkbox和radio有点特殊,Bootstrap针对他们做了一些特殊化处理,主要是checkbox和radio与label标签配合使用会出现一些小问题(最头痛的是对齐问题).使用Bootstrap框架,开发人员无需考虑太多. <form role="form"> <h3>案例1</h3> <div class="checkbox"> <label> <input typ

[ATL/WTL]_[中级]_[原生的复选框(checkbox button)和单选按钮(radio button)实现透明背景效果解决方案]

场景: 1. mfc,wtl的原生控件都是通过父窗口拦截 WM_CTLCOLORSTATIC 事件来修改子控件的颜色和背景色,CStatic可以通过返回HOLLOW_BRUSH来绘制透明背景: m_HollowBrush = AtlGetStockBrush(HOLLOW_BRUSH); 但是如果使用manifest文件使用最新 外观样式的话,返回HOLLOW_BRUSH对checkbox和radio button没有任何效果,原背景还是存在.虽然通过自绘一个checkbox和radio but

html 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐

对 input与label同时设置CSS input,label{ vertical-align:middle; }

吾八哥学Selenium(三):操作复选框checkbox/单选框radio的方法

复选框checkbox和单选框radio是web网站里经常会使用到的两个控件,那么在web自动化测试的时候如何利用Selenium来操作这俩控件呢?今天我们就来简单入门练习一下! html测试页面代码如下: <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <title>学Python网 - seleni

css3美化复选框checkbox

css3美化复选框checkbox:http://www.helloweba.com/view-blog-295.html

QTableView中嵌入复选框CheckBox 的四种方法总结

搜索了一下,QTableView中嵌入复选框CheckBox方法有四种: 第一种不能之前显示,必须双击/选中后才能显示,不适用. 第二种比较简单,通常用这种方法. 第三种只适合静态显示静态数据用 第四种比较适合扩展,它除了可以嵌入复选框,还可以通过paint()绘制其它控件,图片等自定义风格. 第一种方法是:编辑委托法 这种方法直接利用委托中重载createEditor(),激活QCheckBox,这个缺点是必须双击/选中,才能显示CheckBox控件.一般不满足我们实际中的直接显示的需要.可以

单选按钮RadioGroup与复选框CheckBox

在AndroidApp应用中,单选按钮和复选框也是经常使用的,下面我们一起学习一下.我们需要学习Android中的基本控件:(1)单选按钮RadioGroup.(2)复选框CheckBox. 一.设计登录窗口 打开"res/layout/activity_main.xml"文件.  1.分别从工具栏向activity拖出1个单选按钮列表RadioGroup(注意自动包含3个单选按钮RadioButton).2个复选框CheckBox.1个按钮Button.这3个控件均来自Form Wi

jQuery 操作复选框(checkbox) attr checked不起作用

jQuery 更改checkbox的状态,无效 $(this).attr("checked", false).checkboxradio("refresh");     //应该这么写吧,少了$这个东东~~~跟js混淆了 jQuery 操作复选框(checkbox) attr checked不起作用 这 天用到jQuery功能,想实现一个简单的复选框动态全选或全不选,结果测试发现 attr(‘checked’,'checked’);与attr(‘checked’,t