Design question

HairyHun

Masturbating Bandit
Oct 11, 2007
576
2
0
Hello,

On a page. I have a menu in a table to the right and I have a large image to the left.

I'd like to setup somewhere when you hover over the links on the right, the image changes to the left.

How hard is this? Is this a Javascript trick? Any sugestions on how I can get this done?

Thanks
Peter
 


Try to find some roundup posts with jQuery practices and scripts. Google it or check SmashingMagazine.com
 
Put this in the header as a js function:
<script type="text/javascript">
function imagechange(img) {
document.getElementById('divname').style.backgroundImage = 'url(images/' + img + ')';
}
</script>

and put this in every anchor link

onmouseover="imagechange('bg.jpg');"

example:

<html>
<head>
<title>Tester</title>

<script type="text/javascript">
function imagechange(img) {
document.getElementById('divname').style.backgroundImage = 'url(images/' + img + ')';
}
</script>
</head>

<body>
<div id="divname" style="height: 200px; width: 500px;"></div>
<a href="#" onmouseover="imagechange('bg.jpg');">link</a>
</body>
</html>