$('menu_home').observe('mouseover', dropdown('submenu_home'));
    $('menu_home').observe('mouseout', dropdown('submenu_home'));

These 2 lines are your offensive lines of code.  Try this instead:

    $('menu_home').observe('mouseover',
dropdown.curry('submenu_home'));
    $('menu_home').observe('mouseout',
dropdown.curry('submenu_home'));

The logic, is you need to pass a function reference, and not the
actual function itself to .observe.  Since you want to prefill some
arguments, you use the curry method on the Function object to do this
for you.

On Oct 2, 5:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> if got the following problem,
> if you go tohttp://www.webcustoms.nl/zend_wcustoms/then the menu
> will appear and dissappear again, if i go with my mouse over the home
> button again,. nothing happens.
>
> My JS code
> :
> document.observe('dom:loaded',
> function()
> {
>     dropdown = function(name)
>     {
>         if( $(name).getStyle('display') == 'none' )
>         {
>             new Effect.Morph(name,
>             {
>                 style: ({ height: '60px' }),
>                 duration: 0.4
>             }),
>
>             $(name).setStyle({ display: 'block' });
>
>             new Effect.Appear('submenu_lists',
>             {
>                 duration: 1.5
>             });
>         }
>         else
>         {
>             new Effect.Morph(name,
>             {
>                 style: ({ height: '0px' }),
>                 duration: 0.4
>             }),
>
>             setTimeout("$('" + name + "').setStyle({ display:
> 'none' });", 400),
>
>             new Effect.Fade('submenu_lists',
>             {
>                 duration: 0.4
>             });
>         }
>     }
>
>     $('menu_home').observe('mouseover', dropdown('submenu_home'));
>     $('menu_home').observe('mouseout', dropdown('submenu_home'));
>
> });
>
> what am i doing wrong..
>
> sincerly,
>
> Pascal
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to