I have a notification div which dissapears after 5 seconds. How to add a fade out effect that the disappearing would be smooth and nice.
My code now:
<script type="text/javascript">
setTimeout(function(){
document.getElementById('notification').style.display = 'none';
}, 5000);
//5secs
</script>
This function will start counting after document ready. Can be added anywhere you want. As long as its between
<script></script>tags or in a differne JS file.jsfidlle showing this: http://jsfiddle.net/jGtTP/