1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
(function($){
var methods = {
init : function( options ) {
// Create some defaults, extending them with any options that were provided
var settings = $.extend( {
authentification:false
}, options);
this.show();
return $(this).each(function(){
alert("dans return each function");
$("#double").live('dblclick',function() {
var item = $(this);
item.after('<a href="#" class="ec-input-validation"/></a>');
});
$('.ec-input-validation').live('click',function() {
this.update();
return false;
});
});
},
show : function( ) {alert("ok show");},
hide : function( ) {},
update : function( ) {
$.ajax({
});
}
};
$.fn.editcontent = function(method){
if ( methods[method] ) {
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist !' );
}
};
alert(methods.init());
})(jQuery); |
Partager