I'm trying to create a fade in fade out effect to apply on page load and when leaving the page... But I need it to use only css.
My boss wants this effect, but i don't want to use javascript (I'm afraid it won't always work, and it is not working properly...)
The javascript for this effect is this, does anybody know how to do this using only css?
<script type="text/javascript">
$(document).ready(function() {
$("body").css("display", "none");
$("body").fadeIn(2000);
$(".link").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(1000, redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}
});
</script>