Created
November 15, 2011 15:48
-
-
Save anonymous/1367386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>JQuery - FadeIn() et FadeOut() - Exemple</title> | |
<script type="text/javascript" src="jquery-1.3.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$("#boutonFadeOut").click(function () { | |
$("#contenu").fadeOut(); | |
}); | |
$("#boutonFadeIn").click(function () { | |
$("#contenu").fadeIn(); | |
}); | |
$("#boutonIntelligent").click(function () { | |
if ($("#contenu").is(":hidden")) { | |
$("#contenu").fadeIn(); | |
}else { | |
$("#contenu").fadeOut(); | |
} | |
}); | |
}); | |
</script> | |
<style> | |
body{ | |
font-size: 14px; | |
} | |
input{ | |
width: 125px; | |
background: #000; | |
color: #FFF; | |
border: 1px solid #000; | |
cursor: pointer; | |
font-size: 13px; | |
} | |
.mesBouttons{ | |
width: 440px; | |
border: 1px solid #000; | |
padding: 5px; | |
margin: 10px; | |
} | |
.contenu{ | |
width: 450px; | |
height: 100px; | |
border: 1px solid #000; | |
padding: 5px; | |
margin: 5px; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>JQuery - FadeIn() et FadeOut() </h1> | |
Utilisation des fonctions de la librairie javascript. | |
<div class="mesBouttons"> | |
<input type="button" id="boutonFadeOut" value="Tester Fade Out" /> | |
<input type="button" id="boutonFadeIn" value="Tester Fade In" /> | |
<input type="button" id="boutonIntelligent" value="Bouton Intelligent" /> | |
</div> | |
<div id="contenu" class="contenu"> | |
Le contenu de mon div | |
</div> | |
Le restant de ma page | |
ici je voudrias que Monsieur Vieilledent face un lien qui en plus d'aller qq part (une ancre nommée par exemple) fasse aussu un fade out de la div contenu... | |
<hr /> | |
<a href="http://top-news.fr/demos/JQuery-fadeIn-fadeOut.rar" title="Télécharger les sources">Télécharger les sources</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment