/    Sign up×
Community /Pin to ProfileBookmark

Your assistance please if you can help

I run a web site at [url]www.champcarnews.com[/url] and although the site is reasonable so I am told, I am keen to make some adjustments.

the one thing I would like to do is to have an image at the top of the page fixed in a location which rolls over to a new image each time a link further further down the page is passed over with the mouse.

I know how to do this with a basic image and a link using the Dreamweaver 4 package for a one off link and I know how to do swap images

but I am at a loss to see how for example

12 different links in a column can show up 12 different images in the same spot on the page at the same time. Somone told me it could be done using java but this is not an area I am famliar with, can this be doen and can this be done using Dreamweaver 4

so any assistance would be appreciated

regards

Shaun
[url]www.champcarnews.com[/url]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Dec 16.2002 — Help me understand this.

on your webpage at a specific point

you want the images to appear when any link 1+ is mouse over on the page?

Khalid
Copy linkTweet thisAlerts:
@ShaunauthorDec 16.2002 — Yes like this site http://www.microsoft.com/hardware/mouse/womb_info.asp

does that make sense

any help would be appreciated

thank you
Copy linkTweet thisAlerts:
@khalidali63Dec 17.2002 — here you go,

Let me know if you come accross any problems

Copy all of the code below in the body section and njoy


<Script Language="JavaScript">

/*

In the code below I have assumed that in this directory where this html file is,

there is an image directory that has 3 images buttin1.gif and so on.

make sure you chane Image paths to appropriate image paths in your system.

If you desire to dd more images then just the path values in the indexArray

indexArray[4] = "<img src="images/button3b.gif" width="167" height="27" alt="Third Image" border="0">";

indexArray[5] = "<img src="images/button3b.gif" width="167" height="27" alt="Third Image" border="0">";

and so on.Once this is done the create relative table cells just like below,

the only parameter u will need to change in the function calls in mouse over or out events is the index value.it should

follow the sequence.

In case you want to change the default image that displays all the time when user is not initiating a mouseover event

then put the default image path in the

indexArray[0] = "here default image path"

Let me know if you have n e more questions on this

Khalid Ali

*/

var indexArray = new Array();

indexArray[0] = "Image will be displayed in this space.";

indexArray[1] = "<img src="images/button1b.gif" width="167" height="27" alt="First Image" border="0">";

indexArray[2] = "<img src="images/button2b.gif" width="167" height="27" alt="Second Image" border="0">";

indexArray[3] = "<img src="images/button3b.gif" width="167" height="27" alt="Third Image" border="0">";

function swapImage(index,command){

var obj = document.getElementById("imageDisplay");

if(index>0 && command=='on'){

obj.innerHTML = indexArray[index];
}else{
obj.innerHTML = indexArray[0];
}

}

</Script>

</head>

<body>

<div id="imageDisplay" style="position:absolute;width:200pt; height:50pt;">Image will be displayed in this space.</div>

<span id="links" style="position:absolute;margin-top:50pt;">

<table cellspacing="2" cellpadding="2" border="1">

<tr>

<td>

<a href="somepage.html" onmouseover="swapImage(1,'on');" onmouseout="swapImage(1,'off');">First Link 1</a>

</td>

</tr>

<tr>

<td>

<a href="somepage.html" onmouseover="swapImage(2,'on');" onmouseout="swapImage(2,'off');">Second Link 2</a>

</td>

</tr>

<tr>

<td>

<a href="somepage.html" onmouseover="swapImage(3,'on');" onmouseout="swapImage(3,'off');">Third Link 3</a>

</td>

</tr>

</table>

</span>
×

Success!

Help @Shaun spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...