The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Iframes default border in IE, My iframe bug fix is not working
cloudesign
post Mar 17 2007, 11:38 AM
Post #1





Group: Members
Posts: 2
Joined: 17-March 07
Member No.: 2,232



I'm having trouble figuring out why my iframe is looking like hell in this site: www.piedegigante.net when I pasted directly from another site that I created: www.justresultstexas.com .

Look at the source, it's identical, yet the default frame around the iframe is showing in the piedegigante site. I can't figure out what I'm doing wrong! If any one could look at my code, it would be greatly appreciated.

Here's the code I'm looking at.

CODE

<script type="text/javascript" language="JavaScript">

window.onload
= function() {
    //document.getElementById('ifrm').contentWindow.document.body.style.border = 0
    noborder = document.getElementsByTagName('iframe');
    
    for (i=0; i<noborder.length; i++) {
        noborder[i].contentWindow.document.body.style.border = 0;
    }
    
    //alert(noborder.length);
    
    //.contentWindow.document.body.style.border = 0
    
}




function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
  }
}

function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;  
    return false;
  }
  else return true;
}
//-->

</SCRIPT>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Mar 17 2007, 01:45 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(cloudesign @ Mar 17 2007, 05:38 PM) *

I'm having trouble figuring out why my iframe is looking like hell in this site: www.piedegigante.net when I pasted directly from another site that I created: www.justresultstexas.com .

Look at the source, it's identical, yet the default frame around the iframe is showing in the piedegigante site.

No idea why they are different, but it seems the border goes away when using the FRAMEBORDER attribute in the IFRAME. Setting it with javascript doesn't seem to work, though.

Otherwise I'd rather include the framed content with server-side includes (SSI or PHP), then you'd avoid all the extra hassle (not to mention the usual frame problems).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
cloudesign
post Mar 22 2007, 12:02 AM
Post #3





Group: Members
Posts: 2
Joined: 17-March 07
Member No.: 2,232



can someone please look at my sites and tell me what I could be doing wrong?

Can anyone point me to a server-side include tutorial or solution? I sually work in Flash, and I have to admit I'm pretty new to all this.

I really want to use the rotator on the header in piedegigante.net and don't want to reaload the page everytime the content changes. The I found out that using Iframes causes a problem with indexing..... any ideas on a solution where I can keep the flash image rotator in the header?

This post has been edited by cloudesign: Mar 22 2007, 12:02 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Midian
post Mar 22 2007, 10:31 AM
Post #4





Group: Members
Posts: 4
Joined: 21-March 07
Member No.: 2,280



Site one runs in Standards Mode, site two in Quirks mode. IFrames behave differently in each mode.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 07:55 AM