zoukankan      html  css  js  c++  java
  • jquery switch

    <!DOCTYPE html>
    <html>
        <head>
    
        </head>
        <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
        <link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
        <script type="text/javascript"  src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
        <script src="https://unpkg.com/bootstrap-switch"></script>
     
        <body>
                <input type="checkbox" data-value="id" class="switch" />    data-on-text="open"
                 ontext offtext
                  size   null, 'mini', 'small', 'normal', 'large'
                  onColor offColor    'primary', 'info', 'success', 'warning', 'danger', 'default'
        </body>
    
        <script stype="javascript/text">
    
            $(".switch").bootstrapSwitch({
                 onText: "Open",           
                 offText: "Close",           
                 onColor: "success",    
                offColor: "primary",
                onSwitchChange: function(event, state) {
                    console.log(this); // DOM element
                    console.log(event); // jQuery event
                    console.log(state); // true | false
                    console.log($(this).data('value'));
                    state=false;
                }
            });
            $(".switch").bootstrapSwitch("size" ,"large").bootstrapSwitch('state',true);
    </script>
        
    </html>
  • 相关阅读:
    用于区分IE的:条件注释
    详解css:background
    scrollTop总为零原因;如何查看滚动条的位置或者说滚动条的滚动距离(待完善)
    过滤器Filter与监听器Listener
    JSP标签
    servlet
    JSP
    一个CSS简单入门网站
    开始写博客了!
    _nop()
  • 原文地址:https://www.cnblogs.com/LiuFengH/p/10876485.html
Copyright © 2011-2022 走看看