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
| <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Document sans nom</title>
</head>
<body>
<table align="center">
<tr height="17">
<td width="25%"></td>
</tr>
<tr>
<td width="30%"><a href="#" id="1" >Soudain lété dernier</a></td>
</tr>
<tr>
<td><a href="#" id="2">Un tramway nommé désir</a></td>
</tr>
<tr>
<td><a href="#" id="3">Portrait dune Madone</a></td>
</tr>
</table>
<table align="center">
<tr>
<td valign="top" width="325"><div style="position:absolute; width:325px; height:200px;">
<table id="gallerie" style="position:absolute;" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="310" width="330" ><img src="img/portrait.jpg"></td>
</tr>
<tr>
<td height="310" width="330" ><img src="img/portrait1.jpg"></td>
</tr>
<tr>
<td height="310" width="330"><img src="img/portrait2.jpg"></td>
</tr>
</table>
</div></td>
</tr>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <!-- jQuery est inclus ! -->
<script >
$("#1,#2,#3").click(function(){alert("id du bouton cliqué :"
+$(this).attr('id')
+', top :'+(-310*$(this).index())
+', i :'+$('td').index());
$('#gallerie').css("marginTop",-300*($(this).index())+'px');
})
</script>
</body>
</html> |