PDA

View Full Version : Disabling Scroll Bars in Frames?



Rob W
05-28-2005, 11:31 AM
Basically, I'm using '_blank' to spawn a new window with the content in on www.killikngtheoldway.com, but there seems to be a bug in IE. It works fine in FF, but IE displays and error message in the status bar. Sourfce code, if it helps:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Killing The Old Way</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body bgcolor="#000000" text="#FFFFFF" link="#CCCCCC" vlink="#CCCCCC" alink="#999999" onLoad="MM_preloadImages('../proto3/splash/SplashButtonOver.png')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="splash/SplashTitle.png" width="638" height="155"></div>
<div align="center"></div>

<div align="center"><a href="#" onClick='window.open("ktow.htm", "newWindow", "width=760,height=510");'click here to open window in fixed sizetarget="_blank" onMouseOver="MM_swapImage('Image2','','splash/SplashButtonOver.png',1)" onMouseOut="MM_swapImgRestore()"><img src="splash/SplashButton.png" name="Image2" width="300" height="80" border="0"></a></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"><font color="#808080" size="-3">Best viewed in 1024x768
on Firefox.</font></td>
</tr>
</table>
</body>
</html>


Thanks in advance for any help.

jscheuer1
05-28-2005, 05:24 PM
Your example page is not working in IE6 at the moment and the other example you give is a complicated mixture of framesets, PHP and javascript. Simply removing scrollbars from a frame is easy, in the frame's tag set scrolling to 'no' (<frame scrolling="no">). However, using a script to replace them is a bad idea for folks without javascript. So, give this a shot, in the script add this line:
iecompattest().style.overflow='hidden'just before this line:
function positionit(){Unfortunately this will remove both horizontal and vertical scrollbars. There is a way to remove only one or the other but, only in IE. Just make sure your content for this frame is not wider than 740px minus any other frame widths on the page and most folks will see it OK.

Rob W
05-28-2005, 05:48 PM
Hrm... I worked out the <frame scrolling="no"> and tried to get in there with an edit concerning my other problem (which you quickly discovered) before anyone replied. Sorry about that, but thanks anyway. I'm not quite sure what that first piece of code is supposed to do, however... are you suggesting it as an alternative to <frame scrolling="no">?

Either way, thanks for your help. Now about this IE thing...

jscheuer1
05-28-2005, 06:05 PM
Try it, you'll like it. It will remove scrollbars for that page in javascript enabled browsers, no matter where that page is.

Rob W
05-29-2005, 06:25 PM
Ah, handy. Ta very much.