Forum Moderators: open

Message Too Old, No Replies

togglediv, triggered from flash, not working in IE

         

tobias project

5:31 pm on Aug 3, 2007 (gmt 0)

10+ Year Member



hi there. I am using a tried and tested javascript for toggling DIVs on and off.. it works and looks great in Firefox, but for some reason will not trigger properly in IE.. mind you, I am triggering them from a Flash menu, which I will show the code after... in IE only the first "toggle" happens, instead of all of them. Here's the Javascript:

<script language="Javascript">
<!--
function toggleDiv(id,flagit) {
if (flagit=="1"){
if (document.layers) document.layers[''+id+''].display = "show"
else if (document.all) document.all[''+id+''].style.display = "block"
else if (document.getElementById) document.getElementById(''+id+'').style.display = "block"
}
else
if (flagit=="0"){
if (document.layers) document.layers[''+id+''].display = "hide"
else if (document.all) document.all[''+id+''].style.display = "none"
else if (document.getElementById) document.getElementById(''+id+'').style.display = "none"
}
}
//-->
</script>

and here is the Flash actionscript for the button:

on (release) {
getURL("support.html", "box");
getURL("javascript:toggleDiv('titlebanner',1)" );
getURL("javascript:toggleDiv('rightgear',1)" );
getURL("javascript:toggleDiv('wordsright',1)" );
getURL("javascript:toggleDiv('rightart',0)" );
}

like i said. works like a charm in Firefox.

Ps. that "support, box thing opens up content in an iframe, which is one of the elements i am "toggling" with the javascript. (which worked fine in both browsers, so that can't be it.)

any help would be appreciated.

tobias project

5:34 pm on Aug 3, 2007 (gmt 0)

10+ Year Member



sorry.. it's IE 6 i am not seeing it.. if anyone needs to see the whole shebang up and running it's here:

[eroder.com...]

tobias project

8:31 pm on Aug 3, 2007 (gmt 0)

10+ Year Member



it's ok. i fixed it.. i took out the extra stuff around the ID in the JS. so now it's just (id) and it works in IE.