обычно делают с помощью функции JQuery
slidetoggle
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Спойлеры</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<style>
#spoiler {
width: 400px;
height: 400px;
}
a{
display: block;
}
</style>
</head>
<body>
<a id="spoiler-href" href="#spoiler">Нажми меня</a>
<img id="spoiler" src="http://ivrika.ru/wp-content/uploads/2012/10/radost-na-ivrit-simha.jpg" alt="">
<script type="text/javascript">
$(document).ready(function(){
$('#spoiler-href').click(function(){
$("#spoiler").slideToggle('slow');
return false;
});
});
</script>
</body>
</html>