The function below was used in two .php documents. This code works perfectly in the first but in the second document it only executes the first two assignment statements in the (mode==”on”) condition.
In the first document “popoutfg” is an iframe found in the parent window.
In the 2nd document “popoutfg” is an iframe found within another iframe located in the parent window.
So basically the problem is in the 2nd one it only executes these two: temp1.style.visibility="visible"; and
temp2.style.visibility="visible"; .
Please and thank you! =3
function popout(mode, links, width, height, paddingh, paddingv)
{
var temp1 = document.getElementById("popoutfg");
var temp2 = document.getElementById("popoutbg");
if(mode == "on")
{
temp1.style.visibility = "visible";
temp2.style.visibility = "visible";
temp1.style.width = width;
temp1.style.height = height;
temp1.style.left = paddingh;
temp1.style.right = paddingh;
temp1.style.top = paddingv;
temp1.style.bottom = paddingv;
temp1.src = links;
}
if(mode == "off")
{
temp1.style.visibility = "hidden";
temp2.style.visibility = "hidden";
}
}
Add
before
Invalid Argument error suggests that you are not setting the width parameter legitimately. If this doesn’t help let me know the value you saw in alert and we will try to further investigate.