English 中文(简体)
• 如何一度 j草?
原标题:How to setting jquery plugin once instance?

I ́m在“ j鱼”中工作,我有一处错误,即希望修改假肢一例选择,但在尝试时,即改变所有情况的选择。 奥基,我的办公室是可怕的,比我制定法典要好。 是一种通用语言......

(单位:美元) 页: 1

$.fn.interruptor = function(options){
    // Variable iniciales
    var esMetodo = (typeof options ==  string ),
            args = Array.prototype.slice.call(arguments, 1),
            returnValue = this;

    // Previene la llamada a los métodos internos       
    if(esMetodo && options.substring(0, 1) ==  _ ) return returnValue;

    (esMetodo)
        ? this.each(function(){
            var instance = $.data(this,  interruptor );
            console.dir(instance);
            return ($.isFunction(instance[options])) ? instance[options].apply(instance, args) : returnValue;
        })
        : this.each(function(){
            ($.data(this,  interruptor ) 
                || $.data(this,  interruptor , new $.interruptor(this, options))._init());
        });

        return returnValue;
} // fin $.fn.interruptor

$.interruptor = function(elem, options){
    this.config = $.extend(true, $.fn.interruptor.defaults, {numero: parseInt(Math.random()*100)}, options);
    this.id = $(elem).attr( id );
};

$.interruptor.prototype = {
    _init: function(){
        console.info(this.config.numero);
    },
    setter: function(k, v){
        this.config[k] = v;
        return false;
    },
    getter: function(){
        return this.id;
    },
    debug: function(msg){
        console.info(msg);
        console.dir(this.config);
    }
};


//Definición de los valores por defecto.
$.fn.interruptor.defaults = {
        numero: 0,
        img:             images/iphone_switch_square2.png ,     // Dirección base en la que se encuentra la imagen que genera el interruptor
        estado:     true,                                                               // 0 => OFF, 1 => ON 
        deshabilitado: false,                                                       // Indica si el plugin se encuentra actualmente deshabilitado
        duracion: 200,                                                                  // Duración en milisegundos del cambio de estado
        funcionOn : function(){alert ( On );},                  // Definimos la función que se ejecuta en el On
        funcionOff : function(){alert ( Off );}                 // Definimos la función que se ejecuta en el Off
};})(jQuery);

请任何人帮助我。

图十

最佳回答

Ok, 只是回答问题...... 我的法典有一处错误:

该法典行是错误的。

(a) 《公约》附件一所列缔约方的国家信息通报;

正确的路线包括一个空洞的字典:

(a) 《公约》之下的方法学问题:

因此,我需要 in。 这是一种白天错误,即 am。

这样,现在就能够一度让我的gin子选择。

问题回答

暂无回答




相关问题
jQuery - ScrollTo and Serial Scroll not working together

I have tested the scrollTo() plugin, but I need a way to stop the scrolling animation, so I am looking at serialScroll(). Here is what I used with scrollTo: $( #scroller ).scrollTo( 1000px , 3000); ...

jQuery deconstructors for plugins?

I m using the Galleria plugin inside an Accordion plugin to display images in a super cool way. A problem occurs, however, when I open up a new tab (in the accordion) then come back to the gallery tab....

XPCOM Security issues

I m developing a Firefox plugin using XPCOM, I ve not yet read all the docs, but as far as I can see, A plugin is simply a DLL that provides services via a XPCOM interface and interacts with the ...

Ruby on Rails plugin development process

I m considering developing aspects of a website as Rails plugins for reuse. My question is about the development process. Since each of these plugins will provide a "slice" of functionality, should ...

help mongrel wont start

I have decided to switch from Restful authentication to authlogic.. so what I did was delete every file and folder that got installed when I downloaded the plugin.. now when I try to "ruby script/...

Basic MEF workflow/usage

I m looking to a framework which will allow me to have a simple plugin system in my .NET application. It seems MEF is the framework which Microsoft is endorsing, and will become part of .NET 4 (it ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

java plugin cache and dynamic IP host

I m trying to use Amazon S3 and Amazon Cloudfront CDN to deliver the jar files of my applet application. I m seeing several cache misses of my jars by the java plugin. This is a show-stopper for me, ...

热门标签