0

Can anyone tell me how to use Effect.toggle() to toggle to left and right instead of up and down? Or is there any other effect in Scriptaculous that does this ?

Geek Num 88
  • 5,264
  • 2
  • 22
  • 35
Crays
  • 2,458
  • 9
  • 27
  • 31

1 Answers1

1

Unfortunately the toggle() method only supports 3 effects appear, slide, and blind - if you want to do left to right I would suggest using the morph() method as you can put any styles in there and they will be changed back and forth

for example

// close the div horizontally
$('firstdiv').morph('width:0px;');

//open the div horizontally
$('firstdiv').morph('width:auto;');
Geek Num 88
  • 5,264
  • 2
  • 22
  • 35