0

Hello,
I am new to javascript and am aware that this topic is well documented, but not in the way I need the script to work?

I am able to show/ hide a div using the the following:

function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
} else {
e.style.display="none"
}
return true;
}

With a link using:
<a href="#" onClick="return toggleMe('flashOverlay')">Info</a>

The problem I have is that I need to toggle this script with a link in Flash MX, which will not allow me to use "onClick=". Is it possible to have the div show/hide via <a href></a> only?

Thanks in advance

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by buggsword
0

Not in the usual sense.

You could have two pages, one with the div hidden, the other with it shown, and link each page to the other one.

0

I got it working using the following:

function showHide() {
    for (var i=0; i<expandCollapse.arguments.length; i++) {
        var element = document.getElementById(expandCollapse.arguments[i]);
        element.style.display = (element.style.display == "none") ? "block" : "none";
    }
}


<a href="javascript: showHide('flashOverlay')">Search site</a>

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.