Question : Jquery: Change banner when hover over text and icon

Hi,
I'm looking to use JQuery where I change a banner upon hovering over some text and an icon.

There will be five different banner each with an icon and text associated with each and when the user hovers over the relevant icon and text the banner will display the related banner.

By default the banner will need to default to the first banner.

Many thanks

Answer : Jquery: Change banner when hover over text and icon

Test page :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
<html>
<head>
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script language="javascript">
	banners = new Array();
	banners["one"]="http://images.uulyrics.com/cover/d/david-banner/album-certified.jpg";
	banners["two"]="http://www.universal-playback.com/assets/images/0002/1216/bill-bixby-as-dr-david-banner-in-the-incredible-hulk.jpg";
	banners["three"]="http://data-allocine.blogomaniac.fr/mdata/8/9/2/Z20060830185424267203298/img/edward_norton.jpg";
	$(document).ready(function() {
		$(".one,.two,.three").hover(function() {
			$("#banner").attr("src", banners[$(this).attr("class")]);
		});
		$("#banner").attr("src",banners["one"]);
	});
</script>
</head>
<body>
<div class="one">I'm the text number one!</div><br />
<div class="two">I'm the text number two!</div><br />
<div class="three">I'm the text number three!</div><br />
<img class="one" width="96" src="http://www1.istockphoto.com/file_thumbview_approve/4565081/2/istockphoto_4565081_number_one.jpg" /><br />
<img class="two" width="96" src="http://l.nmimg.net/images/number_two.jpg" /><br />
<img class="three" width="96" src="http://farm1.static.flickr.com/107/279583606_01243e2d4f.jpg" /><br />
<br />
<h1>BANNER :</h1>
<img id="banner" width="480" />
</body>
</html>
Random Solutions  
 
programming4us programming4us