script.aculo.us fade in/out with same click

  • Started
  • Last post
  • 2 Responses
  • Shepstar15

    Any Ajax guys can help me out, I want to use the script.aculo.us script to fade/in out a submenu for a webpage.
    The test scripts only show a possibility with two buttons. One to fade in and one to fade out.

    I'd like to use one button, first click fade in, second click fade out.

    And if possible if you click menubutton 1 and submenu1 fades in and the click menubutton 2 the submenu1 fade out and the submenu2 fades in.

    Is that somehow possible?
    Thankx for the help in advance

  • Shepstar150

    Well I found a way, with this link:
    <a href="#" onclick="Effect.toggle('submenu_about','appear'); return false;">

    but if I have two submenus how can I tell them when one fades in the other should fade out.

    Would appreciate any help

  • Shepstar150

    Ok I got this far, which would work pretty fine but I can't get the first submenu to lay exactly over the second one.
    Anyone got an idea?
    If I use position:absolute it would work, but then they appear in the top left corner of my browser window and not where the should appear.

    <div id="submenu_about" style="display:none; position:relative; top:0; left:0; z-index:1;">Submenu1</div>
    <div id="submenu_media" style="display:none; position:relative; top:-20; left:0; z-index:2;">Submenu 2</div>