Skip to content

Instantly share code, notes, and snippets.

@fstamour
Created February 20, 2013 01:26
Show Gist options
  • Save fstamour/4991905 to your computer and use it in GitHub Desktop.
Save fstamour/4991905 to your computer and use it in GitHub Desktop.
Code Jquery minimal pour avoir une div (ou n'importe-quel balise) que l'on peut afficher/cacher.
<!DOCTYPE html>
<html>
<head>
<title>
Dev
</title>
<script type="text/javascript" src="jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(this).find(".slidingDiv").each( function() { $(this).slideToggle(); } );
});
});
</script>
</head>
<body>
<div class="show_hide" > <a href="javascript:void(0)">Show/Hide Json</a>
<div class="slidingDiv" > </div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment