[help] Frames And Links

Hey I'm a pretty unexperienced HTML coder, and I am making a website with frames. I have a title frame, a menu frame, and a main frame. Is there a way to make a link so that only the main frame changes, but the others are left alone?

thanks

-------------------------

Help threads need [Help] tags ;)

The Topic Has Been Tagged

// Seph

#135209

in the HTML page where you have the frames defined, give them the name="" attribute, and then in frame where you click the links, give it a target="{frame's name}". I haven't worked with frames in a while so it may be a little off. Also, you could add in the link on the page itself. Ie, href='http://' target="_blank">

#135213

correct me if im wrong.

the a href="" is the page I am linking to

and the target is the frame I want that link in?

#135224

Originally posted by bhound89@Mar 25 2004, 07:01 PM

correct me if im wrong.

the a href="" is the page I am linking to

and the target is the frame I want that link in?

correct

#135226

ok, i did that, but when i click a link, it opens that html file in a new window.

if it makes any difference, the links are in an image map like this

<html>
<map name=menu>
<area shape=rect coords="0,0,164,52" href="../../unavailable.html" target="{main}">
<area shape=rect coords="0,73,164,125" href="../../unavailable.html" target="{main}">
<area shape=rect coords="0,146,164,198" href="../../unavailable.html" target="{main}">
</map>
<img src="../../unavailable.html" usemap="#menu" border=0>
</html>

and this is how my main frame in the index is set up

<frame src="../../unavailable.html" scrolling="yes" name="main">

#135231

remove the {}'s

#135237

thanks that worked

#135245

im new here.

i am working on a personal website, and i was wondering how would i code my site so that if i click on a link it will change 3 different iframes on various places in the layout?

#145561

Crap! You said iframes! I thought you did regular frames. I am still posting this because I have already finish typing it and I spent a while on it. I'll try to see if there is an easy fix to work with iframes.

Oh man I did this once. I'll try to explain it as well as I can just in case. You need to use Javascript. Javascript is another language like HTML, but you can do more advanced things.

Use this Javascript Function, place it in your

of the page with the links:
<script language="JavaScript">
<!-- Multiple Pages Load Script
function setFrames(first,next) {
parent.main.document.location.href = first + ".htm";
parent.second.document.location.href = next + ".htm";
}
-->
</script>

Here is a description of what this is. You start with the line "<script language=JavaScript>" to tell the browser that you are not using HTML coding and switch to another language, javascript. The "<!-- bla bla" is a safety measure so that if the browser doesn't understand Javascript, it wob't do the coding inside. In normal HTML you would use the "<!-- My comment -->" to put comments in the coding. Now you are starting a function. A function is a set of actions to do that can be called on whenever you want to do them. In this case we are calling it "setFrames". In JavaScript, capitals count. "setframes" is different from "setFrames". Now you put in the variables that you want to pass to the function. No varables would look like "()". Separate the variables with a , . To start the function you need to enclose the instructions in "{}".

The two lines are identical so I will inform you on one line, then tell you the differences. "parent" is the top page. You index (where you have defined the frames) is the parent. You want to go into a certain frame, so you use the name of the frame as a property "parent.main". "document" is, well, the document, and location is the location. But you cannot tell it where to go at that. You need the "href" like "" in HTML. And so the line to tell a certain frame to go to a link is "parent.{frame name}.document.location.href" and now your telling it to set it to (with the "=") to the variable "first" and add the text ("+") ".htm". Change ".htm" to the appropriate extension (".htm", ".html"). Every line need to end with a ";".

Now in the second line, we changed the "main" to "second" and instead of using "first" we use "next" because we don't want to go to the same place twice. End the instructions with "}". End the saftey measure with " -->". And switch back to HTML with "". Now we set this the function up. Lets go to change the pages. Do the coding as normal, but when you come to the links, add this:

<a href="javascript:setFrames('index2','secondary')">

. In the "href" property, we are switching to javascript with "java script:". We call the function "setFrames" and are passing the variables with "index2" and "secondary". Remember to enclose the variables in "()" as we did in the fuction. And since we already used " to start the property value in the HTML portion, use the single ' to enclose the text for the text of the variables and separete them with a , .

PM me if you need anything else clarified.

Like I said this is for frames. I think I only have to modify the "parent.{name}.document.location.href" a little, but I am not sure.

#145859

wow, i havent been here in a while. anyways, i did a total redisign to avoid the whole three iframes thing.(thnx for your help though) and well www.digitalskies.tk is the result. im uploading the finished site tonite. and also if this was resurecting the topic or was put in the wrong spot im sry bout that.

#181336

nother new question:

How do you center layers in dreamweaver? or just in html?

hop someone can help me

#181339

For CSS:

text-align: {right, center, left} without braces.

For HTML:

align="{right, center, left}" without braces.

Is that what you are asking for? If it is and it doesn't work, try to either put it in the item that holds what you want to center.

#181434

thanks wiz but i dont really get it, (im n00bish with this)

where od i insert it into this

<div id="Layer1" style="position:absolute; left:0; top:0; width:340px; height:270px; z-index:1"></div>

i cant do it right :(

#181440

Originally posted by carbonfiber@Jun 24 2004, 07:38 AM

thanks wiz but i dont really get it, (im n00bish with this)

where od i insert it into this

<div id="Layer1" style="position:absolute; left:0; top:0; width:340px; height:270px; z-index:1"></div>

i cant do it right :(

Although, it may not work here, if you another div layer that this is inside, you would have to put it in there. If not, you could just add another div layer, holding the aforementioned div layer, that just has that one property.

#181443

see here

i have three other layers inside 1 layer1, i need layer 1 to be centered over the shadowy image, maybe this is a little more clear ;) , thanks wiz (or anyone else)

#181484

This might fix it. As of right now, you have

<div id="Layer1" style="position:absolute;top:23px; width:550px; height:400px; z-index:3; left: "center;>

Copy and paste this

<div id="Layer1" style="position:absolute;top:23px; width:550px; height:400px; z-index:3; text-align: center;">

What happened was "left" got in there somehow, you probably clicked something, it needs to be 'text-align'; and 'center' was outside of the quotes, thus it won't apply that style.

From looking at the source, that should fix it. But you never know.

#181530