<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>tab</title>
    <style>
        *{margin:0;padding: 0}
        ul,li{list-style: none;}
        .active{
                background: gray;
                display: block;
        }
        .hide{display: none;}
        ul{
            overflow: hidden;
        }
        ul li{
            width:50px;
            height: 50px;
            float: left;
            border-radius: 3px;
            text-align: center;
            line-height: 50px;
        }
        .dis{display:block;}
        .dis1{display:none;}
    </style>
    <script src="jquery-1.8.3.min.js"></script>
</head>
<body>
    <div class="container">
        <ul class="tabs">
            <li class="active">on</li>
            <li id="off">off</li>
        </ul>
            <div id="tab1" class="dis">2111111111111111111111111</div>
    </div>
    <script>
        $(document).ready(function(){
            
            $(".tabs li").click(function(){
                $(".tabs li").removeClass("active");
                $(this).addClass("active");
                if($("#tab1").hasClass("dis")){
                    $("#tab1").removeClass("dis");
                    $("#tab1").addClass("dis1");
                }
                else
                {
                    $("#tab1").removeClass("dis1");
                    $("#tab1").addClass("dis");
                }
            });
        })
    </script>
</body>
</html>

jquery实现on/off开关按钮的更多相关文章

  1. 巧妙利用jQuery和PHP打造类似360安全卫士防火墙功能开关(类似iphone界面)效果

    安全卫士防火墙开启关闭的开关,可以将此功能应用在产品功能的开启和关闭功能上. 准备工作为了更好的演示本例,我们需要一个数据表,记录需要的功能说明及开启状态,表结构如下: CREATE TABLE `p ...

  2. 基于Bootstrap的jQuery开关按钮插件

        按钮 下载 使用方法 首先要在页面中引入依赖文件: jquery.Bootstrap.Bootstrap Switch CSS和Bootstrap Switch JS.这里用的是bootstr ...

  3. 基于Bootstrap的超酷jQuery开关按钮插件

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAAA2CAIAAAC0tsfoAAAB/0lEQVR4nO3bQWrCQBTGcc/mbVz0DD

  4. 基于Bootstrap的jQuery开关按钮组合

    Bootstrap是一款由Twitter推出的开源前端开发包,功能非常强大.今天我们要分享的这款jQuery开关按钮组合就是基于Bootstrap框架的,看了按钮的主题样式,也都是Bootstrap的 ...

  5. 【转】基于Bootstrap的超酷jQuery开关按钮插件

    基于Bootstrap的超酷jQuery开关按钮插件

  6. 使用jQuery实现类似开关按钮的效果

    转自:http://www.cnblogs.com/linjiqin/p/3148228.html 本案例实现类似开关按钮效果. 页面有下拉列表.文本框.按钮等表单元素,大致实现如下效果:1.页面一加 ...

  7. jQuery滑动开关按钮效果

    效果图: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...

  8. light7结合jquery实现开关按钮

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...

  9. jquery开关按钮效果

    .circular1{ width: 50px; height: 30px; border-radius: 16px; background-color: #ccc; transition: .3s; ...

随机推荐

  1. sharepont 2013 隐藏Ribbon 菜单

    引用:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.Web.Comma ...

  2. C语言 04 进制

    %d 或者%i 十进制 %c 输出字符 %p 输出地址 %f 输出小数 %o 八进制 %x 十六进制 一个int类型变量占4字节,占32bit(位) 例子:十进制 int=12  转二进制 0000 ...

  3. vc6 使用的那些事

    VC6.0中Release下调试模式设置 http://blog.csdn.net/wangqinghao/article/details/7730428

  4. Duilib 开发中的小经验

    # duilib开发中收集的小代码 # ## 1 窗体创建 ## - 窗体多继承于 public WindowImplBase ,简单的定义几个函数就可以实现:拖曳caption移动(设置xml窗体的 ...

  5. linux 使用 rz 和 sz 命令

    linux系统 root权限 lrzsz安装包 ①. 安装 编译安装 root 账号登陆后,依次执行以下命令: tar zxvf lrzsz-.tar.gz cd lrzsz- ./configure ...

  6. CSS2样式中选择器的介绍

    这里主要是对css2中的选择器进行了一下总结!

  7. libevent源码分析:eventop

    eventop:定义了event_base使用的后端IO复用的一个统一接口 /** Structure to define the backend of a given event_base. */ ...

  8. WebForm Application Viewstate 以及分页(功能性的知识点)

    Application: 全局公共变量组 存放位置:服务器 特点:所有访问用户都是访问同一个变量,但只要服务器不停机,变量一直存在于服务器的内存中,不要使用循环大量的创建Application对象,可 ...

  9. No module named 'urllib2'

    import urllib2 response = urllib2.urlopen('http://www.baidu.com/') html = response.read() print html ...

  10. 18-ES6(1)

    第18课-ES6(1) 模块化 1.export和import // model.js export default let m = 1; // 出错 export default n = 2; le ...