Forum Moderators: open
I'm having the same problem a while ago that someone else had where Netscape won't recognize the 100% value for height in an iframe tag - it just shows nothing. This other person posted a solution, I tried it, but it didn't work (basically if it detects netscape, it displays a fixed value, but for other browsers it stays 100%).
Can anyone help me? This was the code that the guy posted (back in Feb)
>>>/* browser detection */
var isNS6 = isNetscape6();
function getGeckoVersion() {
var isGecko = navigator.product == 'Gecko';
return isGecko? parseInt(navigator.productSub) : 0;
}
function isNetscape6() {
var gv = getGeckoVersion();
return gv? gv <= 20020508 : false;
}
function isMozilla_1_1() {
var gv = getGeckoVersion();
return gv? gv >= 20020826 : false;
}
#################################################
then, if it's a netscape6 make the iframe absolute height [don't forget to write the "id" too]:
#################################################
<iframe src="iframe.htm" id="main" name="main" width="620" marginwidth="0" height="100%" marginheight="0" scrolling="auto" frameborder="0"></iframe>
<script language="JavaScript">
if (isNS6) {
document.getElementById('main').style.height = "470px";
}
</script>
>>>
Overall, its my impression that Netscape/Gecko tends to collapse heights whenever the rules allow... and possibly some times when the rules don't strictly allow it, as well. In any case, it certainly has differences with MSIE, so your 100% value is going to get interpreted differently from the start as the browser processes the external source file for the <iframe>.