Solved

referencing another page

Posted on 2000-05-18
6
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

724 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