Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iframes, need HELP!! plz...

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
hey, I need some help...does anyone know how I can create iframes?? I created this cool interface with photoshop 5.5 and I wanna use it on webpage. The setup is like this:
When the user clicks any of the buttons that are at the bottom of the interface, I want the link associated with that button to be displayed inside the interface. Know what I mean??
I saw this kind of feature on alot of websites, but I can't get it work. Also will the iframe feature work both on Netscape and Internet Explorer??
 
for nn - use layer.src - just like iframe for ie...
 
I do not understand just what you want to do but concerning layers and iframes I found this code:

<!-- An online tutorial can be found at -->

<!-- THREE STEPS TO INSTALL LOAD HTML:

1. Copy the coding into the HEAD of your HTML document
2. Add the onLoad event handler into the BODY tag
3. Put the last coding into the BODY of your HTML document you will be loading -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!-- Original: Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site: -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin
var nn4 = (document.layers);
var nn6 = (document.getElementById && !document.all);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
function loadPage(id,nestref,url) {
if (nn4) {
var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
lyr.load(url,lyr.clip.width)
}
else if(ie4) parent.contentFRM.location = url;
else if(ie5 || nn6) document.getElementById('contentFRM').src = url;
}
function showPage(id) {
if (ie4) {
document.all[id].innerHTML = parent.contentFRM.document.body.innerHTML;
}
else if(nn6 || ie5) {
document.getElementById(id).innerHTML = window.frames['contentFRM'].document.getElementById('theBody').innerHTML;
}
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onload=&quot;parent.showPage('contentLayer')&quot;>

<!-- STEP THREE: Copy this code into the BODY of your HTML document you will be loading -->

<a href=&quot;javascript:loadPage('contentLayer',null,'load-html-demo.html')&quot;>Load Page</a>
<iframe name=&quot;contentFRM&quot; id=&quot;contentFRM&quot; width=&quot;0&quot; height=&quot;0&quot; frameborder=&quot;0&quot;>
</iframe>
<div id=&quot;contentLayer&quot; style=&quot;position:absolute; width:345px; height:115px; z-index:1; left: 186px; top: 304px&quot;></div>

<p><center>
<font face=&quot;arial, helvetica&quot; size&quot;-2&quot;>Free JavaScripts provided<br>
by <a href=&quot; JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.98 KB -->

I modified it and use it for my menu.

Bob
 
>>Bob:
so, does it work fine in ur case??? (i told'ya that i have problems with thus stuff...)
 
Hey Bob, does that code that u entered mean that Netscape will recognize iframes also??
On the plus side, I got my iframe to work just like how i want it to on my website...[only for IE]
Check it out and tell me what u think ok?? Keep in mind, i'm still not done. I'm gonna add more stuff on the downloads link...
I have not failed; I merely found 100,000 different ways of not succeding...
 
It should work in Netscape but I never checked to see if it does. If it does not work in Netscape, on my web site is a link to download the IE browser......hahahahaha

It works perfect for me, I use it for my drop down menu at
Bob
 
GUJU, if u'll check this script, it contains the followin:

if (nn4) {
var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
lyr.load(url,lyr.clip.width)
}

that means, as i wrote before, that in nn new content loads directly into the layer, nn doesnt support iframes

got it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top