It’s very simple to create the slider itself, all you need to do is
draw a box for the “track”, nest another box inside it for the
“thumb”, make sure that these elements have memorable names, and then
apply the Protaculous action to the page.
http://freewaypro.com/actions/downloads/
Set the Library picker to “scriptaculous”. (Later, after you’ve
debugged things, you can switch this to scriptaculous-packed for a
really huge improvement in page load time.)
In the first Function Body code window, add the following script:
new Control.Slider('thumb','track', {});
replace ‘thumb’ and ‘track’ above with the actual IDs of the elements
you drew in Freeway. Preview in a browser, and you should be able to
slide the thumb along the track.
Not very useful in and of itself, so you will then need to add a
callback function to send the updated value when the slider has been
changed. Inside the curly-brackets in the above script, add this:
onChange: function(value){alert(value);}
And you should see a popup happen when the slider is released. There
is also an onSlide event which updates in real-time, but that
probably wouldn’t be useful in your context.
Your script could be extended to have the updated value sent straight
to the server with an Ajax request, or pretty much anything else you
can imagine doing. The alert() here is simply to show you what values
are generated.
You can also set the thumb to any default value you like, and your
script could be dynamically populated with the current value, so the
slider shows what the current rating is before any sliding happens.
Walter
On Mar 31, 2008, at 11:26 AM, Jamie Turner wrote:
Hi, everyone.
I’m using FW Pro 5 and noticed the cool slider effect on the
Script.aculo.us website. I’d like to incorporate that effect into
my website so that visitors can “rate” the articles they read on my
website. In other words, a user would read the article, then they
would rate it using the slider feature and hit “submit” to have
their rating added to all the other ratings of that article from
previous readers.
I’ve got one of our programmers working on a Java script to do this
right now, but I’m wondering if there’s an easier way to do it
using Script.aculo.us.
Suggestions? Thoughts?
Thanks,
Jamie
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options