http://learn.javascript.ru/play/Ib6W1b
<!DOCTYPE HTML>
<html>
<head>
<style>
#myDiv {
background: #000;
height: 100px;
width: 100px;
transition: opacity 0.5s;
-moz-transition: opacity 0.5s;
-o-transition: opacity 0.5s;
-webkit-transition: opacity 0.5s;
}
.hide {
opacity: 0;
}
</style>
</head>
<body>
<div id="myDiv"></div>
<script>
var myDiv = document.getElementById('myDiv').onclick = function() {
var hide = this.classList.contains('hide');
this.classList[hide ? 'remove' : 'add']('hide');
}
</script>
</body>
</html>
Ну, а с display уже сами.