...

View Full Version : Change multiple frames with one link



crewblunts
03-05-2005, 05:38 AM
Hi all,

I was wondering if there was a way to change multiple frames with one link. I have tried the onclick but it does not work because the links are part of an image map. I have also tried some JS that I found on the web but it isn't working either. If anyone knows a way to make a page autoload another page in another frame. that would be beautiful.

Any help would be appreicated.

Regards,

Phil V

_Aerospace_Eng_
03-05-2005, 11:59 AM
try something like this

<script type="text/javscript">
function loadsrc(){
parent.framename1.src='http://www.codingforums.com';
parent.framename2.src='http://www.codingforums.com';
}
</script>
and set the link up like this

<a href="#" onclick="loadsrc();return false">Load Content</a>
that should work

crewblunts
03-06-2005, 12:29 AM
I tried that but it will not work b/c i cannot reference and onclick in an image map. And if I try to do it with:

<a href="javascript:loadsrc();">
It doesn't work. I get a loadsrc not defined error.

Thanks for your help,

Phil V

_Aerospace_Eng_
03-06-2005, 12:32 AM
do you have a live link you can show us or the code to your page?

crewblunts
03-06-2005, 12:43 AM
Of course here is the code


<html>

<head>
<script type="text/javscript">
function loadsrc(){
parent.main.src='http://www.codingforums.com';
parent.contents.src='http://www.codingforums.com';
}
</script>
<title>Map</title>
<base target="main">
</head>

<body bgcolor="#ffffff" text="#000000" link="#000000"
vlink="#000000" alink="#0000FF">



<IMG SRC="images/None.jpg" WIDTH=150 HEIGHT=140 BORDER=0 ISMAP USEMAP="#None.jpg">

<MAP NAME="None.jpg">
<area shape="rect" coords="0,0,150,19" href="javascript:loadsrc();">
<AREA SHAPE="RECT" COORDS="0,20,150,38" HREF="nutrition.html" target=contents>
<AREA SHAPE="RECT" COORDS="0,38,150,59" HREF="articles.html" target=contents>
<AREA SHAPE="RECT" COORDS="0,60,150,81" HREF="training.html" target=contents>
<AREA SHAPE="RECT" COORDS="0,82,150,101" HREF="links.html" target=contents>
<AREA SHAPE="RECT" COORDS="0,101,150,120" HREF="aboutme.html" target=contents>
<AREA SHAPE="RECT" COORDS="0,120,150,140" HREF="sendto:dash@dashsfitnessfiles.com">
</MAP>
</body>
</html>

crewblunts
03-06-2005, 12:49 AM
I have also tried


<head>
<script language="javascript" type="text/javascript">
<!--
function le(t5, s2)
{
parent.frames[s2].location = t5;
}
//-->
</script>
<title>Map</title>
<base target="main">
</head>

with


<area shape="rect" coords="0,0,150,19" href="javascript:le('programs.html', 'contents');">


thanks again

_Aerospace_Eng_
03-06-2005, 12:51 AM
i dont see where your frameset is at? is this page part of your frameset? can u make provide a link that has your frameset uploaded along with the pages that go in it? or give us the code to the frameset also?

crewblunts
03-06-2005, 12:53 AM
sorry


<html>

<head>

<title>Dash's Fitness Files</title>
</head>

<frameset rows="50" framespacing="1">

<frameset rows="11%,731" framespacing="1" border=0>
<frame name="top" scrolling="no" noresize target="contents" src="logo.html">
<frameset cols="63,324">
<frame name="contents" target="main" src="imagemap.html" scrolling="auto">
<frame name="main">
</frameset>

<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>

_Aerospace_Eng_
03-06-2005, 01:30 AM
you had an extra frameset tag there, here try this for your frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>

<head>

<title>Dash's Fitness Files</title>
</head>

<frameset rows="200,*" framespacing="1" border=0>
<frame id="top" name="top" scrolling="no" noresize target="contents" src="logo">
<frameset cols="63,324">
<frame name="contents" target="main" src="imagemap.html" scrolling="auto">
<frame id="main" name="main">
</frameset>

<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>

</html>
and try this for your imagemap.html page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Map</title>
<style type="text/css">
body {
background:#FFFFFF;
color:#000000;
}
a:link {
color:#000000;
}
a:visted {
color:#000000;
}
a:active {
color:#0000FF;
}
</style>
</head>

<body>
<img src="images/None.jpg" width="150" height="140" style="border:0px;" ismap usemap="#None.jpg">
<map name="None.jpg">
<area shape="rect" coords="0,0,150,19" href="http://www.codingforums.com" target="top" onclick="parent.document.getElementById('main').src='http://www.yahoo.com';">
<area shape="rect" coords="0,20,150,38" href="nutrition.html" target="contents">
<area shape="rect" coords="0,38,150,59" href="articles.html" target="contents">
<area shape="rect" coords="0,60,150,81" href="training.html" target="contents">
<area shape="rect" coords="0,82,150,101" href="links.html" target="contents">
<area shape="rect" coords="0,101,150,120" href="aboutme.html" target="contents">
<area shape="rect" coords="0,120,150,140" href="sendto:dash@dashsfitnessfiles.com">
</map>
</body>
</html>
see if that works for you, it worked for me

crewblunts
03-06-2005, 02:12 AM
That worked beautifully! Thank you so much. I have beent rying to figure this out for too long now. I really appreciate it!

Thankfully,

Phil V



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum