Thanks, had a good read, figured it out in part.
Now I'm stuck trying to introduce an array to do my bidding ...
Example below.

The array is an example of how I want to loop through to use those
values.
Underneath is the perfect code for clicking an Anchor and changing its
BGcolour differently each time.

Any ideas?

$(document).ready(
        function(){
                var arrValues = ['green','aqua','blue','purple'];

                $("#item_list > li > div > a").toggle(
                function(){
                        $(this).css('background-color', 'green');
                }, function() {
                        $(this).css('background-color', 'aqua');
                }, function() {
                        $(this).css('background-color', 'blue');
                }, function() {
                        $(this).css('background-color', 'purple');
                });
});




On Oct 22, 3:46 am, mkmanning <michaell...@gmail.com> wrote:
> .toggle() allows you to rotate through multiple functions, you might
> want to check it out in the 
> docs:http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...
>
> On Oct 21, 2:58 am, The Danny Bos <danny...@gmail.com> wrote:
>
>
>
> > I've got one for ya, JQuery and Ajax.
>
> > I want to have a button image, let's stay it's inactive state it's a
> > grey circle, when someone clicks it once, it'd change to a blue circle
> > (update associated DB field to "blue"), click it again and it becomes
> > a red circle (update the DB field to "red") and so on. So users keep
> > clicking until they get the right color, then move on to the next
> > one.
>
> > I've seen something similar in Google where you can star emails with
> > different stars.
>
> > Any idea how you'd do this?
> > It's got me stumped.

Reply via email to