...

View Full Version : iFrames Help



DawgieDog
12-23-2002, 03:26 AM
This is hard to explain now.
How do make it so that each link loads diff content in an iFrame(mine is called start.html). This is really hard for me to explain. Do I have to make one iFrame for each link?

ez4me2c3d
12-23-2002, 04:47 AM
your links on start.html would look like this...


<a target="frameName" href="page.html">link</a>

and then in your iframe code add a name and id attribute like so.


<iframe src="default.html" name="frameName" id="frameName"></iframe>

this will tell the link to load inside the iframe.

DawgieDog
12-23-2002, 05:17 AM
Originally posted by ez4me2c3d
your links on start.html would look like this...


<a target="frameName" href="page.html">link</a>

and then in your iframe code add a name and id attribute like so.


<iframe src="default.html" name="frameName" id="frameName"></iframe>

this will tell the link to load inside the iframe.

start.html is my iFrame. I'm telling the links to load in iFrame. So.. I do it the other way around?

allida77
12-23-2002, 05:23 AM
If I understand you right this can be done with javascript and all you need is one iframe.

function submitToIFrame(url) {
document.frames("iLinks").src=url;
}

<a href="javascript:submitToIFrame('testPage.html')">TestPage</a>

<iframe id="iLinks">
</iframe>

For each link you are dynamically setting the src of the iframe.

ez4me2c3d
12-23-2002, 05:53 AM
i know it's a hard concept to follow... look at this simple example.

http://rap.midco.net/ez4me2c3d/html/iframe.html

allida77
12-23-2002, 05:59 AM
duh I never work with frames and I have always just used js with my iframes. Oh well I guess you learn something everyday.

Nairb
12-30-2002, 09:16 AM
How do you change the colours of those iFrames?

cg9com
12-30-2002, 03:02 PM
an iframe is a frame displaying a seperate document, to change the colors of the frame would be to change the background color of the document the iframe is showing ...

http://search.microsoft.com/gomsuri.asp?n=1&c=rp_Results&siteid=us&target=http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/iframe.asp

DawgieDog
12-30-2002, 04:31 PM
Sweet! I actually got it to work! I used what EZ posted it worked. I've been reading and learning a bit about HTML and then going to ASP :D. Now.... how do I change the size of the iFrame ?:o

redhead
12-30-2002, 06:04 PM
how do I change the size of the iFrame ?

<iframe ... width="400" height="400">

DawgieDog
12-31-2002, 12:53 AM
Originally posted by redhead
<iframe ... width="400" height="400">

Ohhh! Right, I knew that, just wasn't thinking :p.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum