<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://peter-ajtai.com/jquery/jquery-1.4.2.min.js"></script>
</head>
<body>
<h2>Click on a word to make all the other ones disappear:</h2>
<div id="one">One</div>
<div id="two">Two</div>
<div id="three">Three</div>
<div id="four">Four</div><br/><br/>
<input type="button" value="Show all" />
<script type="text/javascript">
var divs = $('#one, #two, #three, #four');
divs.click(function ()
{
divs.not(this).slideUp('slow');
});
$('input').click(function ()
{
divs.slideDown('slow');
});
</script>
<h2>The Code (fresh off the presses, displaying what was used above):</h2>
<?php
include_once "../php/codify-function.php";
// Show code ##################################################################
codify(file_get_contents(__FILE__), 'javascript');
?>
</body>
</html>