tags:

views:

55

answers:

2

I have the follow code:

$("#headerimg" + currentContainer).slideUp(function() {
  setTimeout(function() {
    $("#headertxt").slideUp(100).css({"display" : "block"});
    animating = false;
  }, 500);
});

Now the pictures animate from bottom to top. But i want that the picture, slide from right to left. What in the code i must change?

+3  A: 

Here is a great tutorial to slide elements in different directions.

from jQuery - slide right to left?

galambalazs
+1  A: 

There is no build-in method like "slideLeft" in jQuery. So you either have to write a little plugin like

$.fn.slideLeft = function(speed){
     return this.each(function(){
        var $this = $(this);
        $this.animate({'width': '0px'}, jQuery.fx.speeds[speed] || 200);
     });
};

or you have to look for an already existing plugin out there.

jAndy