Hey dudes, I have the following function:
$.fn.slideOut = function(speed,dir) {
this.animate({
dir: '-1000px'
}, speed);
};
But the direction (dir) isn’t being carried over and isn’t giving me an error either.
I’m calling it like so:
$('#element').slideOut(500,'top');
So my quesiton = why is it not animating? 🙁
If you want to use a variable property name, you cannot use object literals. You first have to create the object and then set the property with the “array access” syntax: