Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change multiple frames with one link

    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

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    try something like this
    Code:
    <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
    Code:
    <a href="#" onclick="loadsrc();return false">Load Content</a>
    that should work

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:
    Code:
    <a href="javascript:loadsrc();">
    It doesn't work. I get a loadsrc not defined error.

    Thanks for your help,

    Phil V

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    do you have a live link you can show us or the code to your page?

  • #5
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course here is the code
    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>

  • #6
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have also tried
    Code:
    <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
    Code:
    <area shape="rect" coords="0,0,150,19" href="javascript:le('programs.html', 'contents');">
    thanks again

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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?

  • #8
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry
    Code:
    <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>

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    you had an extra frameset tag there, here try this for your frameset
    Code:
    <!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
    Code:
    <!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

  • #10
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •