Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-23-2002, 03:26 AM   PM User | #1
DawgieDog
New Coder

 
Join Date: Oct 2002
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
DawgieDog is an unknown quantity at this point
Unhappy iFrames Help

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?
DawgieDog is offline   Reply With Quote
Old 12-23-2002, 04:47 AM   PM User | #2
ez4me2c3d
Regular Coder

 
Join Date: Dec 2002
Location: Minneapolis, MN
Posts: 208
Thanks: 0
Thanked 1 Time in 1 Post
ez4me2c3d is an unknown quantity at this point
your links on start.html would look like this...

Code:
<a target="frameName" href="page.html">link</a>
and then in your iframe code add a name and id attribute like so.

Code:
<iframe src="default.html" name="frameName" id="frameName"></iframe>
this will tell the link to load inside the iframe.
__________________
anthony
ez4me2c3d is offline   Reply With Quote
Old 12-23-2002, 05:17 AM   PM User | #3
DawgieDog
New Coder

 
Join Date: Oct 2002
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
DawgieDog is an unknown quantity at this point
Quote:
Originally posted by ez4me2c3d
your links on start.html would look like this...

Code:
<a target="frameName" href="page.html">link</a>
and then in your iframe code add a name and id attribute like so.

Code:
<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?
DawgieDog is offline   Reply With Quote
Old 12-23-2002, 05:23 AM   PM User | #4
allida77
Regular Coder

 
Join Date: Jun 2002
Location: Cincinnati, OH
Posts: 545
Thanks: 0
Thanked 0 Times in 0 Posts
allida77 is an unknown quantity at this point
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.
allida77 is offline   Reply With Quote
Old 12-23-2002, 05:53 AM   PM User | #5
ez4me2c3d
Regular Coder

 
Join Date: Dec 2002
Location: Minneapolis, MN
Posts: 208
Thanks: 0
Thanked 1 Time in 1 Post
ez4me2c3d is an unknown quantity at this point
i know it's a hard concept to follow... look at this simple example.

http://rap.midco.net/ez4me2c3d/html/iframe.html
__________________
anthony
ez4me2c3d is offline   Reply With Quote
Old 12-23-2002, 05:59 AM   PM User | #6
allida77
Regular Coder

 
Join Date: Jun 2002
Location: Cincinnati, OH
Posts: 545
Thanks: 0
Thanked 0 Times in 0 Posts
allida77 is an unknown quantity at this point
duh I never work with frames and I have always just used js with my iframes. Oh well I guess you learn something everyday.
allida77 is offline   Reply With Quote
Old 12-30-2002, 09:16 AM   PM User | #7
Nairb
New to the CF scene

 
Join Date: Dec 2002
Location: Canada
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Nairb is an unknown quantity at this point
How do you change the colours of those iFrames?
Nairb is offline   Reply With Quote
Old 12-30-2002, 03:02 PM   PM User | #8
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
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....cts/iframe.asp
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline   Reply With Quote
Old 12-30-2002, 04:31 PM   PM User | #9
DawgieDog
New Coder

 
Join Date: Oct 2002
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
DawgieDog is an unknown quantity at this point
Cool

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 . Now.... how do I change the size of the iFrame ?
DawgieDog is offline   Reply With Quote
Old 12-30-2002, 06:04 PM   PM User | #10
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
Quote:
how do I change the size of the iFrame ?
<iframe ... width="400" height="400">
__________________
redhead
redhead is offline   Reply With Quote
Old 12-31-2002, 12:53 AM   PM User | #11
DawgieDog
New Coder

 
Join Date: Oct 2002
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
DawgieDog is an unknown quantity at this point
Cool

Quote:
Originally posted by redhead
<iframe ... width="400" height="400">
Ohhh! Right, I knew that, just wasn't thinking .
DawgieDog is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:14 AM.


Advertisement
Log in to turn off these ads.