Solved

overlapping an iframe in ie4

Posted on 2000-03-29
7
336 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 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now