Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

overlapping an iframe in ie4

Posted on 2000-03-29
7
Medium Priority
?
346 Views
Last Modified: 2010-04-09
So IE 5.5 allows you to easily overlap an IFrame with a layer, but how does one accomplish this with IE4 or 5 (preferably 4)? What I am trying to do is set up a drop down type menu on top of the page (using dhtml layers or flash) and show the links in the iframe below, while allowing the top menu to drop down and overlap the iframe. Again, this is easily done in IE 5.5 but I need to figure it out for version 4. Thanks alot!

DB
0
Comment
Question by:DannyBoi
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
rtieland earned 450 total points
ID: 2668187
Hi,
External Source Files
take a look at this page
http://www.dansteinman.com/dynduo/en/source.html 

look by technique 2

this is a script wich makes it possible to read in an external file and put it into a DIV tag. wich is easily to overlap by other tags

yours,
ruben

0
 

Author Comment

by:DannyBoi
ID: 2678078
Is there anyway to load a frame page as the external page? I think my problem now is the body onload command in the frameset page...

thx
0
 
LVL 1

Expert Comment

by:rtieland
ID: 2679051
Hi,
there is a solution to the onload event by checking if the iframe is fully loaded.

by using the update function of my script you can change every div with an other html. it is just that simple
there are two extra functions for hidding and showing of an element.

the script i use is this:

<SCRIPT>
 var doall = (document.all!=null)
 
 function getCSSPElement(id) {
  if (doall)
   return document.all[id]
  else
   return document.layers[id]
  }

 function showElement(id) {        
  var pEl = getCSSPElement(id)
  if (pEl != null)          
   if (doall)
    pEl.style.visibility = "visible"          
   else
    pEl.visibility = "show"      
  }      
 
 function hideElement(id) {
  var pEl = getCSSPElement(id)        
  if (pEl != null)          
   if (doall)
    pEl.style.visibility = "hidden"          
   else
    pEl.visibility = "hide"      
  }
 
 function checkIFrame(destid) {
  var iframe = document.frames[destid+"target"]
  if (iframe == null) {
    document.body.insertAdjacentHTML("beforeEnd","<IFRAME STYLE='width: 0pt; height: 0pt;' NAME='"+destid+"target' SRC=''></IFRAME>")  
    iframe = document.frames[destid+"target"]
   }
  return iframe
  }
 
 function updateContents(destid, src) {
  var el = getCSSPElement(destid)
  if (doall) {
   destFrame = checkIFrame(destid)
   destFrame.location.href = src
   setTimeout("pollIframe('"+destid+"')",200) }
  else
   el.src = src
  }
 
 function pollIframe(destid) {
  var destFrame = checkIFrame(destid)
  if (destFrame.document.readyState == 'complete') {
   var el = getCSSPElement(destid)
   el.innerHTML = destFrame.document.body.innerHTML }
  else
   setTimeout("pollIframe('"+destid+"')",200)
  }    

 function update(destid, src) {
  if (src=="none") {
   var el = getCSSPElement(destid)
   if (doall)
    el.innerHTML = ""
   else {
    el.document.open()
    el.document.write("")
    el.document.close() }
   }
  else  
   updateContents(destid, src)
 }

</SCRIPT>

yours,
ruben
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:DannyBoi
ID: 2682013
ruben-

you da man. if theres any way i can toss you some points on here, let me know how.

daniel
0
 
LVL 1

Expert Comment

by:rtieland
ID: 2684908
i do not know how to upgrade points but i think you gave me enough points. it is good to know that i could be of some help.

yours,
ruben
0
 

Author Comment

by:DannyBoi
ID: 2697109
one last question for you bro - this script wont seem to allow me to load an external page (eg. "http://www.yahoo.com/index.html" as opposed to "myindex.html") into the iframe buffer. It gives an "Access is denied" error.

Thanks for your help, youre a life saver...

Daniel
0
 

Author Comment

by:DannyBoi
ID: 2697112
i think the problem is within getting the properties of a 'foreign' html file - eg. document.readystate and document.body.innerhtml from the pollIFrame() function...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question