Results 1 to 5 of 5

Thread: Disabling Scroll Bars in Frames?

  1. #1
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE "_blank" problem

    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:

    Code:
    <!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.
    Last edited by Rob W; 05-28-2005 at 05:18 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:
    Code:
    iecompattest().style.overflow='hidden'
    just before this line:
    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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...

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Try it, you'll like it. It will remove scrollbars for that page in javascript enabled browsers, no matter where that page is.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ah, handy. Ta very much.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •