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
| <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title></title>
<script src="//code.jquery.com/jquery-1.11.2.js"></script>
<script>
$(function(){
$(".content").on('click',function(){$(".change").fadeToggle( "slow", "linear" );});
});
</script>
<style type="text/css">
.content {
position:relative;
}
.content, .change {
height:90px;
width:216px;
}
.change {
position:absolute;
top:0;
left:0;
background:#ccc;
}
</style>
</head>
<body>
<div class="content">
<div class="change" style="display:none">Le texte qui s'affiche onclick sur l'image puis disparaît ensuite </div>
<img class="change" src="http://www.developpez.net/template/images/logo.png" alt="développez">
</div>
</body>
</html> |
Partager