Event not triggering

Posted by the Hampster on Stack Overflow See other posts from Stack Overflow or by the Hampster
Published on 2010-05-22T08:08:08Z Indexed on 2010/05/22 8:10 UTC
Read the original article Hit count: 250

I have no idea where to start on this one. I have a that does not appear until a button is clicked. This function call works: onclick="highlight('mod_sup_div', true);"

function highlight(aDiv,show) {
    if (show) {
        Effect.Appear('Overlay',{duration: 0.5, to: .80});
        Effect.Appear(aDiv,{duration: 0.5})
        }
    else {
        Effect.Fade('Overlay',{duration: 0.5, to: .80});
        Effect.Fade(aDiv,{duration: 0.5})
        }
    }

In the <div> I have a button to close the window.
<p class="closer"><span onclick="highlight('mod_sup_div',false)">X</span></p> This does not work. The function is not even called, as I made a alert() the first line of the function at it does nothing.

What is odd, is that onclick="Effect.Fade(aDiv,{duration: 0.5})" does work. Other simple javascript functions in the onclick="" work, except for the function call.

Any help as to why this is happening would be very appreciated.

Thanks, Dave

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about javascript-events