Suite des expériences avec jQuery : le toggle
Avec mootools, nous avions écrit :
<script type="text/javascript">
window.addEvent('domready', function() {
var showSearch = new Fx.Slide('recherche', {duration: 750});
showSearch.hide();
$('show_search').addEvent('click', function() {showSearch.toggle();});
});
</script>
Avec jQuery :
<script type="text/javascript">
$(document).ready(function(){
$('#recherche').hide();
$('a#show_search').click(function() {
$('#recherche').toggle(400);
return false;
});
});
</script>

Ajouter un commentaire