zoukankan      html  css  js  c++  java
  • jquery控件的学习

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jquery控件学习</title>
    <script type="text/javascript" src="http://libs.useso.com/js/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
    //控件
    $.fn.test=function(options){
        var optionThis=$(this);
        defaultoptions={
            closeBtn:'#closeBtn'
        };
        even={
            open:function(){
                optionThis.unbind().bind('click',function(){
                    $('body').append($('<div class="layer">').text('这是一个层'));
                    even.close();
                });
            },
            close:function(){
                $(defaultoptions.closeBtn).unbind().bind('click',function(){
                    $('.layer').remove();
                });
            }
            
        };
        even.open();
    };

    $(document).ready(function() {
        $('#openBtn').test({});
    });



    </script>
    </head>

    <body>

    <input type="button"  value="open" id="openBtn"/>
    <input type="button"  value="close" id="closeBtn"/>
    </body>
    </html>

  • 相关阅读:
    linux samba 配置
    实例解读 linux 网卡驱动
    Linux操作系统的安全管理设置
    找回Linux/Unix下各系统的密码
    CF441E Valera and Number
    CF1175F The Number of Subpermutations 题解
    CF1553 比赛记录
    P5618 [SDOI2015]道路修建 题解
    CF 1530 比赛记录
    AT2063 [AGC005E] Sugigma: The Showdown 题解
  • 原文地址:https://www.cnblogs.com/Better-Me/p/4073621.html
Copyright © 2011-2022 走看看