Solved

referencing another page

Posted on 2000-05-18
6
157 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
Comment Utility
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
Comment Utility
0
 

Author Comment

by:reido2
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
<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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now