overlapping an iframe in ie4

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
DannyBoiAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rtielandConnect With a Mentor Commented:
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
 
DannyBoiAuthor Commented:
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
 
rtielandCommented:
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
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
DannyBoiAuthor Commented:
ruben-

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

daniel
0
 
rtielandCommented:
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
 
DannyBoiAuthor Commented:
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
 
DannyBoiAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.