Log in

View Full Version : Iframe action causes link on parent frame to become clickable



thesickest
09-12-2009, 05:35 AM
I'm looking for a script or method on how to Make a link on the parent page. Preferably one that opens a DHTML Modal Iframe window that when an action is performed on that window or a link is clicked and the window is closed the original link that was clicked points to a different url and when that is clicked it takes you to the different url.

Or a way to iframe a page and when the form inside the iframed page is submitted or the iframed page changes to a different url a link becomes available to click.

I wonder if anyone on here is good enough to solve this problem and post some source to work with. I am a beginner to intermediate web developer. I can understand well documented code and make changes but when it comes to writing my own it's like greek. Any help is appreciated.

Thanks Guys!

thesickest
09-12-2009, 06:08 AM
So, i've been messing around with java and onload events and found a solution to my iframe loading quandaries.


<html>
<head>
<script type="text/javascript">
var total_loads=0;
function addload()
{
try
{
total_loads++;

if (total_loads>3)
{
window.parent.document.all["myFrame"].style.display = "NONE";
}
}
catch(err)
{

}
}
</script>
</head>

<body style="background-color:#181720">

<div align="center">
<div style="background-image:url(backdiv.png);overflow: hidden; width: 291px; height: 111px; position: relative;" id="i_div">
<iframe onload="addload()" id="myFrame" name="i_frame" src="url1.php" style="border: 0pt none ; left: -133px; top: -424px; position: absolute; width: 1023px; height: 640px;" scrolling="no"></iframe></div>
</div>
</body>
</html>

Now if i could just figure out how to Make a link trigger that to load and integrate that into the equation i'll have the problem solved. I'm such a JS n00bi3, HELP PLZ! =D

thesickest
09-12-2009, 06:10 AM
Or if i could figure a way to work that script into a dhtml modal popup and integrate the link that way that would be optimal. This is so frustrating. If anyone is a god of JS please help. If you can't do it that's understandable. thanks for looking =)