creating a wizard-like animation with scriptaculous

60 views
Skip to first unread message

michal

unread,
Jan 21, 2008, 1:19:34 PM1/21/08
to Ruby on Rails: Spinoffs
hey guys, i am wondering if its easily possible to create the
following animation with scriptaculous:
you know those wizards where you can press next> and <previous to jump
back and forward within a defined set of "pages" .. i want to define
some DIVs and put content into it ...
lets say 4 DIVs .. each of them has a next and previous link at the
bottom and only one is displayed at a time. now a user clicks next
then the currently displayed DIV should slide to the right and the
next one should slide in from the left to the right ... now when the
user clicks prev then the same happens just into the other
direction ...
something like a carousel

is it easily possible with scriptaculous or do i have to hack a lot?
thx for your help!

Diodeus

unread,
Jan 21, 2008, 1:38:18 PM1/21/08
to Ruby on Rails: Spinoffs
It's pretty easy.

You can put the series of photos together in a DIV with a bit of
spacing between them, then put that inside a DIV with a fixed size and
overflow:hidden. Then just use Effect.Move and move the inside DIV by
the same relative amount, forwards or backwards.

Greg Hemphill

unread,
Jan 21, 2008, 1:46:33 PM1/21/08
to rubyonrail...@googlegroups.com
You might want to look at Glider:

http://railspikes.com/2007/5/14/slider-js-a-javascript-slider-component
http://code.google.com/p/missingmethod-projects/wiki/Glider

I've used it on a couple of sites and haven't had any real problems:
http://www.pricechopper.com/
http://www.dwfreshmarket.com/

but I didn't use the Next/Prev part (wasn't what the client wanted)

Greg

michal

unread,
Jan 21, 2008, 10:14:19 PM1/21/08
to Ruby on Rails: Spinoffs
thanks guys .. this helps a lot !!
Reply all
Reply to author
Forward
0 new messages