Hi Terry,

So a few things:
    function menu_action(item){
         var menuitem = 'div#' + item + ':click';

        Event.addBehavior({
        -->   menuitem  : function(event) {
               new Effect.Highlight(this, { queue: 'end' });
           }

         });
    }

In the addBehavior method you create an object with properties as
functions but in your object you created property called 'menuitem'
literally not 'div#item1:click'.

So if I had code like:
var id = 'matt'
var h = { id: function(){ alert(id) } }
h.matt() ----> fails
h.id() -----> alerts 'matt'

So the nice thing with Event.addBehavior is that it allows you to add
behaviors without doing so inline. Setting the onclick property in HTML
is duplicating efforts. If you want to keep the code inline but make
your html fat, I would say
onclick="new Effect.Highlight(this); greet..."

should work else I would change your id's to 'item_1' that way you
could do something like this

Event.observe(window, 'load', function(){
  Event.addBehavior({
      '.navlinks:click'  : function(event) {
           new Effect.Highlight(this, { queue: 'end' });
           greet2(this.id.split('_')[1])
       }
  })
})

Good Luck,
Matt


On Dec 3, 1:25 pm, Stripe-man <[EMAIL PROTECTED]> wrote:
> Thanks for replying...
>
> Um.. no.. im sorry to report that didnt work :(
>
> On 12/3/06, tobie <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi Terry,
>
> > try:
>
> >         Event.addBehavior({
> >           '.navlink:click'  : function(event) {
> >                new Effect.Highlight(this, { queue: 'end' });
> >            }
> >         });
>
> > regards,
>
> > Tobie--
> "I have learned that you should'nt compare yourself to others - they are
> more screwed up than you think." ...unknown
>
> "In the 60's, people took acid to make the world weird.  Now the world is
> weird and people take Prozac to make it normal." ..unknown
> _____________________________
> Terry Remsik
> stripe-man.dyndns.org
> [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
 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 [email protected]
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