Author Topic: Frames In Html  (Read 1974 times)

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Frames In Html
« on: June 02, 2005, 12:21:29 PM »
Okay, i understand how to set the frames, and how to show a page in each one, but how the heck do I make a link in one frame change the page in another frame?  I keep trying to find it in tutorials and junk, but can't, plus I think levi used frames on the old DO site.
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Frames In Html
« Reply #1 on: June 02, 2005, 04:11:43 PM »
well when you define a frame, give it a name first, eg you have a frameset page:

<frameset cols="25,*">
<frame src="navbar.html" name="navbar">
<frame src="home.html" name="page">
</frameset>

So you use the name attribute to assign each frame a name.
Left frame navbar.html contains your navigation bar.
Right frame home.html will contain your pages.

Now say you're doing a link on navbar.html, write it like so:

<a href="news.html" target="page">News[/url]
etc. the target attribute makes it load the link in whatever frame name is specified in the quotes.

If you want (but this really isn't a good idea) you can change the default, or "base" frame for links if you don't want to specify a target each time, by doing this in your frameset html page:
<base target="page">
That would mean any links that don't have a target attribute saying otherwise, would get loaded into the frame named "page". Again this is really a bad idea.

There are some predefined targets as well that you can use in the quotes:
_self Loads page in the frame the link is in. This is the default if a <base target> tag was not used. (Use when you use a <base target> if you really want to load the link in "self"
_blank Opens this link in a new window. (Some browsers might try to reuse an existing window, if you want to be sure that it won't reuse a window use Javascript to pop up the page).
_parent Opens the page in the parent frameset in which the link is located. Only really useful if you have a frameset inside a frame. (yuck)
_top Opens the page, breaking out of any frames/framesets. (This is always a good idea when you're linking to a totally different, external site. That's my pet peeve on the web, is people with frames linking to external sites, but the site gets loaded in the frame). Could also be used to point to the frameset html file if you want to give users a link to break out of someone ELSE's frames.
_search Not widely supported I imagine (I think it's an IE only thing, I've never used it myself) but loads the link in the browser search sidebar.

And yes, lev did use frames on the DO site.

Good luck, ask if you have questions. :)

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Frames In Html
« Reply #2 on: June 02, 2005, 05:42:53 PM »
thanks hacker
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline omagaalpha

  • Sr. Member
  • ****
  • Posts: 372
Frames In Html
« Reply #3 on: December 04, 2005, 04:48:31 PM »
Did you know vista window that internet explorer come with that pakage software that frames will be no longer supporting annd all WW3 stear way from frames.
Sorry if my grammar and spelling is bad, but I have disablity with it.
Yes, English is the first and only language that I know.