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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Image sur mouseover</title>
<style type="text/css">
* {
font-family : Verdana, Arial;
}
#conteneur {
font-size : 13px;
position : relative;
border : 1px solid #e0e0e0;
width : 800px;
height : 400px;
margin : auto;
padding : 5px;
}
#titre {
width : 600px;
margin : auto;
}
#div_menu {
margin : auto;
width : 600px;
padding : 1px;
border : 1px solid #8a4b08;
}
#div_menu_lien {
width : 100%;
min-height : 30px;
background-color : #f7be81;
}
#div_menu_lien a {
color : #000;
text-decoration : none;
font-size : 13px;
font-weight : bold;
line-height : 30px;
width : 100px;
padding-left : 5px;
display : block;
float : left;
}
#div_menu_lien a:hover {
color : #fff;
background-color : #8a4b08;
}
#div_menu_image {
background-color : #f0f0f0;
height : 170px;
}
#img_menu {
width : 100%;
height : 100%;
}
</style>
<script type="text/javascript">
function showImage(num){
var tImg = [];
var i = 0;
tImg[i++] = "image_menu_1.jpg";
tImg[i++] = "image_menu_2.jpg";
tImg[i++] = "image_menu_3.jpg";
tImg[i++] = "image_menu_4.jpg";
var oImg = document.getElementById('img_menu');
if( oImg){
oImg.src = tImg[num];
oImg.alt = tImg[num];
}
}
</script>
</head>
<body>
<div id="conteneur">
<div id="titre">
<h2>Show Image sur mouseover</h2>
</div>
<div id="div_menu">
<div id="div_menu_lien">
<a href="#" onmouseover="showImage(0);">Menu #1</a>
<a href="#" onmouseover="showImage(1);">Menu #2</a>
<a href="#" onmouseover="showImage(2);">Menu #3</a>
<a href="#" onmouseover="showImage(3);">Menu #4</a>
</div>
<div id="div_menu_image">
<img id="img_menu" src="image_fond_menu.jpg" alt="">
</div>
</div>
</div>
</body>
</html> |
Partager