WOW>..  two awsome suggestions both work!!!!  (I dont have the files updated
yet on the demo link
provided yet)

Just 1 issue with each!!  (sorry)
Peters Example Works great and does exactly what I need..  with one draw
back

It pernamently changes the BG color for that div clicked to the color to the
hover color specified in the css.
odd.  There isnt anything that is specifying this to change to green.
This behavior (of the bgcolor turning
into the hover color) is not consistient.

If i dump this css property . its fine.(i like the hover!)


In Mattews example..  It performs the desired function but the content does
not stay.  It appears for a
split second then hides going back to the default content (as when  you
reload the page).


Summary:
I have decided to go with Peters Example.  I just have to figure out why the
dbcolor turns to the hover color.
I will update my code on that site as soon as I can.

Question:
Can someone please tell me what teh difference between these are:

Event.observe(window, 'load', function(){
//Please note yes.. i am aware of teh { after function()

and

Event.observe(window, 'load', init, false);
//Please note.. yes i am aware of the termination of that line  (  ;   )

Thanks so much for your input, comments and your help.


Terry

On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> 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]
>
>
> >
>


-- 
"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