How about this:
<div id="slideshow">
<div id="a"><img .... /><div>Some description</div></div>
<div id="b"><img .... /></div>
<div id="c"><img .... /></div>
</div>
Then:
Effect.Slideshow("slideshow", { delay.... });
This would take all the children of 'slideshow', and hide them all except
the first, and then switching between them as before.
I like this better because I can now style each image as I want, and I can
also add text, or something else. It allows more freedom, and all the
slideshow code does is hide/show the inner pieces without needing to know
anything about them.
In this case, I don't even need images, I can do this with paragraphs of
text, or whatever else I can find to put in my child DIVs.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gregory
Hill
Sent: Friday, January 13, 2006 12:45 PM
To: [email protected]
Subject: [Rails-spinoffs] anyone interested in an Effect.Slideshow?
I had to make a sort of slideshow for a site I'm working on, and I was
thinking of making it into a Scriptaculous object. Anyone think of
reasons why I shouldn't? You'd have to pass in all the image urls and a
div id, with an optional delay parameter to determine how long to leave
each image up before moving on. I could also have a 'randomize' option,
when set to true it would pull the images randomly. It would cross-fade
them using Effect.Fade and Effect.Appear.
Syntax would be something like:
new Effect.Slideshow('div_id', ['image1.jpg', 'image2.jpg'...], { delay:
#.# (in seconds, with a default of 10 seconds), randomize: true/false
});
The script would create the img tag inside of the div (it'd actually
create 2, 1 hidden and 1 showing, then fade one out while the other
fades in).
What do y'all think of that idea?
If someone's already working on something like that, then cool.
Greg
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs