Javascript Question...
If I have an image in one frame can I make it so that when the image is mouseover'd a small indicator (ie: an arrow) appears on top of an image in another frame?
If I have an image in one frame can I make it so that when the image is mouseover'd a small indicator (ie: an arrow) appears on top of an image in another frame?
Abhishek Reddy posted this at 01:22 — 12th April 2002.
He has: 3,348 posts
Joined: Jul 2001
Is this the same subject as http://www.webmaster-forums.com/showthread.php?s=&threadid=18221 ?
This topic is probably better suited to the Web Page Authoring section. I'm sure one of the mods will be along to sort all that out soon.
As for your question, yes it is possible.
You'd have to have a function in your first frame with the mouseover images which moves a containing the arrow image to the location derived from the arguments for that function.
Like so:
<script type="text/javascript">
function pointArrow(xpos,ypos)
{
parent.frame2.images.arrow.style.visibility="visible";
parent.frame2.images.arrow.style.left=xpos;
parent.frame2.images.arrow.style.top=ypos;
}
function hideArrow()
{
parent.frame2.images.arrow.style.visibility="hidden";
}
</script>
<body>
<img src="blah" onMouseOver="pointArrow(100,100); onMouseOut="hideArrow();">
<img src="blah" onMouseOver="pointArrow(150,217); onMouseOut="hideArrow();">
etc etc.
</body>
In Frame 2:
<body>
<div id="arrow" name="arrow" style="visibility:hidden; position:absolute; z-index:100;"><img src="arrow.gif"></div>
</body>
I think.
Warlord Khan posted this at 05:20 — 12th April 2002.
They have: 35 posts
Joined: Aug 2001
Nar the questions are different, this looked like the right place to post sorry
I have done what you said but I get a run time error.
http://www.centrepointstation.net/test/test.htm
Abhishek Reddy posted this at 12:04 — 12th April 2002.
He has: 3,348 posts
Joined: Jul 2001
That's because you have missed a couple of quotes:
" onMouseOut="hideArrow();" border=0 width="500" height="500">
Warlord Khan posted this at 03:57 — 13th April 2002.
They have: 35 posts
Joined: Aug 2001
I added the quotes in now I get more runtime errors.
http://www.centrepointstation.net/test/test.htm
Abhishek Reddy posted this at 05:39 — 13th April 2002.
He has: 3,348 posts
Joined: Jul 2001
Oh, sorry, I should've mentioned this earlier:
Replace "frame2" in the code with the name of the second frame (where you want the arrow to appear).
In your case, "frame2" should be "info".
Warlord_Khan posted this at 11:27 — 13th April 2002.
They have: 6 posts
Joined: Apr 2002
hmm well it's all up and no runtime errors but well nothing happens.
(same url)
Abhishek Reddy posted this at 12:22 — 13th April 2002.
He has: 3,348 posts
Joined: Jul 2001
Hmm, I still get an error and your code still shows "frame2".
I've cleared my cache so I can't be viewing an older version of the page.
Can you re-upload/update the code?
And what's with the new username?
Warlord_Khan posted this at 07:12 — 14th April 2002.
They have: 6 posts
Joined: Apr 2002
http://www.centrepointstation.net/test/test4.htm
I re-did the test to ultimatley how it will eventually have to look.
But now the image in right.htm (img/map2.gif) does not appear.
The other account wasn't working.
Warlord_Khan posted this at 08:56 — 14th April 2002.
They have: 6 posts
Joined: Apr 2002
btw put yer mouseover the name "Aldalyn" as thats where the onmouseover code is.
Abhishek Reddy posted this at 10:53 — 14th April 2002.
He has: 3,348 posts
Joined: Jul 2001
I'll have a closer look soon, but just quickly:
The qoutes are really messed up here.
Should be
That's the image code for your map, I presume. Well, inside the named arrow, you should have the image of your arrow, and simply leave this map image code outside the .
Like this:
Abhishek Reddy posted this at 10:55 — 14th April 2002.
He has: 3,348 posts
Joined: Jul 2001
Ok, the fix for the javascript error your getting is this:
Change parent.frame2.images.arrow.style... to just parent.frame2.arrow.style...
Warlord Khan posted this at 17:34 — 14th April 2002.
They have: 35 posts
Joined: Aug 2001
cheers mate, it works!
now all I need is to get an answer on the image mapper question in the other forum
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.