Solved

referencing another page

Posted on 2000-05-18
6
185 Views
Last Modified: 2011-10-03
I have a frameset: top,main and banner html pages. I have an image in top.html that changes on certain onmouseover events. Can I reference the image in top.html from an onmouseover event in banner.html?

hope this question makes sense.

ta.
0
Comment
Question by:reido2
  • 3
  • 2
6 Comments
 
LVL 8

Accepted Solution

by:
xabi earned 30 total points
ID: 2820784
Yep:

Example:

parent.page_name.images["imagename"].src = 'foo.gif'

please change "page_name" for the name of the page you give at the frameset and "imagename" for the real image name

xabi
0
 
LVL 8

Expert Comment

by:xabi
ID: 2820788
0
 

Author Comment

by:reido2
ID: 2820920
I cannot get this to work.

my index.html page has one frameset:

<html>
<frameset cols=25%,*>
      <frame name="page1" src="page1.html">
      <frame name="page2" src="page2.html">
</frameset>
</html>

the code on page1.html is:

<html>
<body>
   <img id=me src="button1.gif" onclick=parent.page2.images["fill"].src="button2.gif">
</body>
</html>

the code on page2.html is:
<html>
<body>      
      <img id=fill src="button1.jpg">
</body>
</html>

This should work but it doesn't any ideas?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 22

Expert Comment

by:CJ_S
ID: 2821065
<img id=me src="button1.gif" onclick='parent.page2.images["fill"].src="button2.gif"'>

But this'll only work with IE. For compatibility with NN you should instead use:

<a href="#" onclick='parent.page2.images["fill"].src="button2.gif"; return false;'><img id=me src="button1.gif"></a>

or even

<a href='javascript:parent.page2.images["fill"].src="button2.gif";return false;'><img id=me src="button1.gif"></a>


Good luck,
CJ
0
 
LVL 8

Expert Comment

by:xabi
ID: 2821206
the code on page2.html should be:

<html>
<body>
<img id=fill name="fill" src="button1.jpg">
</body>
</html>

xabi

PS: Note the "NAME" tag
0
 

Author Comment

by:reido2
ID: 2821261
I still could not for the life of me get that to work. I amended the code to read:

onclick=parent.page2.fill.src="button2.jpg"

I have spent too long on this so I will simply use that method.

But thanks anyway.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question