tags:

views:

90

answers:

1

I have the below script to hide the content of one div and show another

$("#"+objCurrentDiv).fadeOut("slow",function(){
  $("#"+objNewDiv).fadeIn("slow");
});

This is giving me the fading effect.Now i want to repalce the fade effect with sliding (left to right. I tried the slide in show method, but could not succeed. Can any one help me to rewrite it?

+2  A: 

Since the standard function .slideDown and .slideUp will do the effect vertically, you have to use .animate like this:

$("#"+objCurrentDiv).animate({'width':'0%','display':'none'},"slow",function(){
  $("#"+objNewDiv).animate({'width':'100%','display':'block'},"slow");
});
Keeper