PDA

View Full Version : Links same across iframes though not linked



Snapafun
Jan 26th, 2010, 11:38 AM
Can't seem to find the answer here though I'm sure it's here, just can't find it.

Basically, what am I missing with:

<div id="leftmenubg">
<iframe id="menuframe" name="snapafunmenu" frameborder="0" style="border-top:none;" src="homeMenu.html" scrolling="yes" ALLOWTRANSPARENCY="true">
</iframe>
</div>
<div id="mainbody">
<iframe id="mainbodyiframe" name="snapafunpage" frameborder="0" style="border-top:none;" src="http://www.snapafun.org" scrolling="yes" ALLOWTRANSPARENCY="true">
</iframe>
</div>

I'm getting the src of http://www.snapafun.co.nz in both iframes :confused:

Using ~

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

mbaker
Jan 26th, 2010, 09:17 PM
I've taken your code and created 20100126-iframes.html :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
<title>IFrame Links</title>
</head>
<body>
<h1>IFrame Links</h1>
<div id="leftmenubg">
<iframe id="menuframe" name="snapafunmenu" frameborder="0" style="border-top:none;" src="homeMenu.html" scrolling="yes" >
</iframe>
</div>
<div id="mainbody">
<iframe id="mainbodyiframe" name="snapafunpage" frameborder="0" style="border-top:none;" src="http://www.snapafun.org" scrolling="yes" >
</iframe>
</div>
</body>
</html>

And a matching homeMenu.html :


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<title>Home Menu</title>
</head>
<body>
<h1>Home Menu</h1>
<p>Test file for <a href="20100126-iframes.html">20100126-iframes.html</a></p>
</body>
</html>

But I can't replicate your problem. Perhaps you could add more code until the problem appears - this will probably point to what the problem is. If not you could try again here with the code that does produce your problem.

Snapafun
Jan 27th, 2010, 07:56 AM
I to went through the same exercise after I had posted my problem. I believe I'm onto something within the css sheet. Apparently, z-index can stuff things up if you try to get ahead of things. Haven't quite nailed what's happening yet but I have finally got the two iframes behaving for now.

Thanks for your efforts, if I can understand fully what it is I've done, I'll post back the results.