hola,
de nuevo
ps viéndolo así,
yo todavía sigo con
mi funcion
toggleEvent
nada mas que mejorada para
que funcione con cualquier evento
Código HTML:
$.fn.toggleEvent = function( e, fn ) {
var args = arguments, i = 2;
while( i < args.length )
jQuery.event.proxy( fn, args[i++] );
return this[e]( jQuery.event.proxy( fn, function(event) {
this.lastToggle = ( this.lastToggle || 1 ) % i == 0 ? 1 : ( this.lastToggle || 1 ) % i;
event.preventDefault();
return args[ this.lastToggle++ ].apply( this, arguments ) || false;
}));
};
ejemplo:
Código HTML:
$("html").toggleEvent("keydown",
function(){
alert("1");
},function(){
alert("2");
},function(){
alert("3");
},function(){
alert("4");
},function(){
alert("5");
}
);
PD. Ya no hace
onclick ni tampoco tiene
eval
camarax
;]