The page loads, listen for a click on the 'emailus' link and pass the
two variables col2 and col3 to the function getContentAlt. Here is the
code


Event.observe(window, 'load', function() {

                var col2 = '/includes/content/contact-col-2.php';
                var col3 = '/includes/content/contact-col-3.php';
                Event.observe('emailus', 'click', getContentAlt(col2, col3));


        });


Now here is getContentAlt. You can see that the first the function
checks for is if the link has a class name of 'current'. So I am
unclear of how I pass 'this' to the function so it knows what link the
user clicked on?



function getContentAlt(col2, col3) {



                if ($(this).hasClassName('current')) {

                        return false;

                        }

                        else {

                                if($('slideshow')){

                                        $('slideshow').remove();

                                        }

                                new Effect.Opacity('footer', { duration: .5, 
to: 0 });
                                new Effect.Opacity('content', { duration: .5, 
to: 0, afterFinish:
function() {

                                        new Ajax.Updater('content', col3, {

                                                method:'get',
                                                evalScripts: true,

                                                onComplete:function(){

                                                        getColHeight();
                                                        new 
Effect.Opacity('content', { duration: .5, to: 1 });

                                                        if($('contact')){

                                                                loadAction();

                                                        }

                                                }

                                        });


                                }});


                                new Effect.Opacity('container', { duration: .5, 
to: 0,
afterFinish: function() {

                                        new Ajax.Updater('container', col2, {

                                                method:'get',

                                                onComplete:function(){

                                                        getColHeight();
                                                        new 
Effect.Opacity('container', { duration: .5, to: 1 });
                                                        new 
Effect.Opacity('footer', { duration: .5, to: 1 });


                                                }

                                        });



                                }});


                                removeClassCurrent();
                                $(this).toggleClassName('current');
                                return false;

                };

}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to