zoukankan      html  css  js  c++  java
  • jQuery插件模板


    jQuery插件模板

    制作JQuery插件的基本框架
    演示:http://www.huiyi8.com/chajian/


    (function($){
        //The jQuery.aj namespare will automatically be created if it doesn't exist
        $.widget("aj.filterable",{
            //These options will be used as defaults
            options: {className : "" },
             
            _create: function(){
                //The _create method is where you set up the widget
            },
                     
            //Keep various pieces of logic in separate methods
            filter: function(){
                //Methods without an underscore are "public"
            },
            jquery插件库  
            _hover: function(){
                //Methods with an underscore are " private"
            },
             
            _setOption: function(key, value){
                //Use the _setOption method to respond to changes to options
                switch(key){
                    case "length":
                        break;
                }   
                $.Widget.prototype._setOption.apply(this,arguments)
            },
            destroy: function(){
                //Use the destory method to reverse everything your plugin has applied
                $.Widget.prototype.destroy.call(this);
            }   
        });
    })(jQuery);

  • 相关阅读:
    Day015 PAT乙级 1013 数素数
    Day014 PAT乙级 1012 数字分类
    Day013 PAT乙级 1007 素数对猜想
    Day012 PAT乙级 1005 继续(3n+1)猜想
    Day011 PAT乙级 1003 我要通过
    Day010 PAT乙级 1002 写出这个数
    Day009 洛谷 P5707 上学迟到
    Day008 洛谷 P2181 对角线
    Day007 Java异常处理
    Fetch()
  • 原文地址:https://www.cnblogs.com/lhrs/p/4151582.html
Copyright © 2011-2022 走看看