Changing iframe visibility on Mozilla not working

Posted by Honski on Stack Overflow See other posts from Stack Overflow or by Honski
Published on 2013-06-29T16:17:03Z Indexed on 2013/06/29 16:21 UTC
Read the original article Hit count: 150

Filed under:
|
|
|
|

I've got a simple iframe that I want hidden until an event from that iframe is fire via easyXDM. It's working fine on Chrome, but somehow not on Mozilla. The event is being fired on both browsers, but only shows the iframe on Chrome. The only way to show the iframe on Mozilla is to call the same code using an onclick event.

HTML:

<a href="#" onclick="shower(); return false;">show frame (always working)</a>
<br>
<iframe src="testsite.php" width="600" height="424" scrolling="no" border="0" id="my-iframe3" style="visibility: hidden;" onload="scrollIFrame();" name="my-iframe3">

Javascript:

function shower()
{
    document.getElementById("my-iframe3").style.visibility="visible";
}

var socket = new easyXDM.Socket(
{
    onMessage: function(message, origin)
    {
        if (message == "hi")
        {
            socket.postMessage("do something");
        } 
        else if (message == "ready")
        {
            shower();
        }
    }
});

Both browsers receive the "ready" message.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html