Solved

overlapping an iframe in ie4

Posted on 2000-03-29
7
344 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 1

Accepted Solution

by:
rtieland earned 150 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

718 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