He mirado el source code in jquery for slideup ...¿Cómo funciona slideUp() en jQuery? Estoy tratando de hacer mi propia slideRIght()
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show", 1),
slideUp: genFx("hide", 1),
slideToggle: genFx("toggle", 1),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function(name, props) {
jQuery.fn[ name ] = function(speed, easing, callback) {
return this.animate(props, speed, easing, callback);
};
});
entiendo que esta es la abreviatura de funciones, por lo que a través de folllow GenFX
function genFx(type, num) {
var obj = {};
jQuery.each(fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
obj[ this ] = type;
});
return obj;
}
y luego fxAttrs
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
],
pero simplemente no puedo entender cómo funciona este código, o cómo iba a ir sobre la creación de una diapositiva o slideLeft Derecha que afecta el atributo de ancho del HTML.
Este es un mejor enlace para 'slideUp': http://james.padolsey.com/jquery/#v=1.2.6&fn=jQuery.fn.slideUp – Neal