views:

2114

answers:

2

Can anyone help me to rewrite the below code which use a fade effect , to use a sliding effect.I want Slide up and Slide Down

 function ShowCostMetrics()
 {
  $("#pnlGraph").fadeOut("slow",function()
   {
    $("#pnlCostMetrics").fadeIn("slow");
   });
 }
 function ShowGraph()
 {
   $("#pnlCostMetrics").fadeOut("slow",function()
   {
     $("#pnlGraph").fadeIn("slow");
    });
 }

Thanks in advance

+2  A: 

Instead of fadeIn/Out use slideDown/Up

 function ShowCostMetrics()
 {
  $("#pnlGraph").slideUp("slow",function()
   {
    $("#pnlCostMetrics").slideDown("slow");
   });
 }
 function ShowGraph()
 {
   $("#pnlCostMetrics").slideUp("slow",function()
   {
     $("#pnlGraph").slideDown("slow");
    });
 }
sasa
+1  A: 

Or you could simply switch all fadeIn() with slideDown() and fadeOut() with slideUp()...

peirix