View Full Version : image hyperlink problem

10-24-2006, 08:19 AM

i have a script that changes an image in the main frame when you hover over a hyperlink in the navigation frame.

however i would like to extend this and make the image that appears to be a hyperlink.

the code i have is below. the navigation frame:-

<script language="JavaScript">

internet_main = window.parent.internet_main("internet_main.html","rollWindow","internet_main");

function getRolling(whichBrief)

internet_main.document.images.rollpic.src = whichBrief;


<li><font color="#DB241C">Residential</font>
<li><a href="desktop" TARGET="internet_main" onMouseOver="getRolling(desktop')">> Orb Surftalk Extra</a></li>
<li><a href="desktop" TARGET="internet_main" onMouseOver="getRolling(desktop)">> Orb Surftalk Extra +</a></li>

the main frame:-

<script language="JavaScript">

a=new Image();a.src="desktop\blank.png";


<img src="desktop\blank.png" name="rollpic">

thanks in advance

Mr J
10-24-2006, 02:12 PM
You could possibly dynamically apply the onclick event to the image and pass the appropriate url

function getRolling(whichBrief,url){
internet_main.document.images.rollpic.src = whichBrief;


10-25-2006, 08:28 AM
not sure how this would work if i had 4 hyperlink, each wioth a different image displayed on hover.

Mr J
10-25-2006, 02:00 PM
If you try it you will see

10-25-2006, 02:32 PM
i've put into my code, but it doesn't seem to work, where is it getting the url from for a particular image?

Mr J
10-25-2006, 07:48 PM
The links in your navigation page would go something like this

<a href="#null" onmouseover="parent.rightframe.showImage('pic01.jpg','http://www.google.com')">Link</a><BR>
<a href="#null" onmouseover="parent.rightframe.showImage('pic02.jpg','http://www.mozilla.org')">Link</a><BR>
<a href="#null" onmouseover="parent.rightframe.showImage('pic03.jpg','http://www.google.com')">Link</a><BR>
<a href="#null" onmouseover="parent.rightframe.showImage('pic04.jpg','http://www.mozilla.org')">Link</a><BR>

10-26-2006, 08:39 AM
i've nearly got it working however when you click on the image it changes the navigation frame and the main frame, i have tried changing the code but not getting anywhere. i have changed your code slightly to get to work so far.

<a href="#null" onmouseover="getRolling('C:/Documents and Settings/Kpatel/Desktop/Orb_Website/Internet Inside Page Layout/orb_surftalk_extra_brief.png','C:/Documents and Settings/Kpatel/Desktop/Orb_Website/Internet Inside Page Layout/orb_surftalk_extra_plan.html')">> Orb Surftalk Extra</a>

10-26-2006, 10:16 AM
All fixed now, thanks Mr J for all your help, much appreciated.