Question

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?

Was it helpful?

Solution

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");
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top