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?

jAndy
  • 231,737
  • 57
  • 305
  • 359
Mike
  • 49
  • 1
  • 4

2 Answers2

3

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

from jQuery - slide right to left?

Community
  • 1
  • 1
gblazex
  • 49,155
  • 12
  • 98
  • 91
1

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
  • 231,737
  • 57
  • 305
  • 359