Click to See Complete Forum and Search --> : Link content to an iFrame
Dark Dragon
09-09-2003, 03:59 PM
Okay..I am in the process of testing out how to make a linked item appear in a iFrame.
Of course there is the matter of figuring out HOW to put in an iFrame buuut.....we'll cross that bridge when we get to it. :D
So assuming that the link tags a href remain the same..I can only assume with my ever faulty logic that I need to somehow allocate the "target" area, ie the iFrame.
Of course I have learned that such matters are more complex so I am wondering where I can find examples of code for various uses of iFrames.
W3C is nice but hard for a putz like myself to decipher without initiating a lobotomy out of self defense....
soccer362001
09-09-2003, 04:26 PM
If you have the link inside the Iframe it should open in the Iframe. If it is out side the Iframe you will have to you (target="name")
Dark Dragon
09-09-2003, 04:35 PM
Well..what I plan to do is have the links on the page itself and the content the link summons would appear in the iFrame.
I have this delusion that it may make it a bit easier instead of new windows popping up or using frames....
Oh, and by the way..I like your Commander Data Avatar.
soccer362001
09-09-2003, 04:37 PM
<a href="whatever" target="iframename">Link</a>
Thanks I like it too!
Dark Dragon
09-09-2003, 04:40 PM
Just like that, eh?
Well then I will try it out as I go along..thanks!
soccer362001
09-09-2003, 04:41 PM
Just like that. And it should work cause I tested it to make sure. I don't want to be giving out false information.
Dark Dragon
09-09-2003, 06:07 PM
Is there a way to alter the background color of an iFrame when it initially appears on the page?
I want it to appear black when a user first comes and then when he/she clicks on links, the bg color of the iFrame then turns white. Can a bgcolor tag be used?
soccer362001
09-09-2003, 06:46 PM
Yes you can. you would need to put you color properties in the file that is your iframe.
<style type="text/css">
<!--
body{background-color:#000000;
}
-->
</style>
Dark Dragon
09-09-2003, 07:17 PM
Cool..thanks! :D
Dark Dragon
09-09-2003, 07:35 PM
Okay..now I have run into a snag.
Right now I am using a CSS rollover code for my links...and in the href I have the link targetted to my iFrame..using its default name of myIframe..as I said earlier, when a user first comes, they will see a stationary logo in the iFrame and if you click on the link, one should see the selected image in the iFrame only the selected pic appears in a new window instead.
Here is the code I have for my single page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body background="imgs/pink.jpg">
<title>iFrame Test Area</title>
<iframe id="myIframe" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0"
width="40%" height="50%" src="imgs/imtitle.jpg" scrolling="no"></iframe>
<style type="text/css">
a.link {
color: black;
text-decoration: none;
font-weight: bold;
}
a.link:hover {
color: red;
}
</style>
<p><a href="imgs/elderman.gif" target="myIframe" class="link">Elderly Man Drawing</a><br>
</body>
</html>
The problem is apparently in the target tag but I don't know what is creating the problem
soccer362001
09-10-2003, 04:02 PM
this should work
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>iFrame Test Area</title>
<style type="text/css">
a.link {
color: black;
text-decoration: none;
font-weight: bold;
}
a.link:hover {
color: red;
}
</style>
</head>
<body background="imgs/pink.jpg">
<iframe name="myiframe" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0"
width="40%" height="50%" src="imgs/imtitle.jpg" scrolling="no"></iframe>
<p><a href="imgs/elderman.gif" target="myiframe" class="link">Elderly Man Drawing</a><br>
</body>
</html>
Dark Dragon
09-10-2003, 05:02 PM
Thanks soccer but I had posted the inquiry in the HTML forum and Pyro told me the same thing...it was so simple I just didn't see it!!!!!
soccer362001
09-10-2003, 05:14 PM
Your welcome any time