I have a button which takes to another html. But is there a way to fade out whole front page by clicking the button and take it to second page. Now I can just fade out the front page by clicking anywhere but when I click the button it reloads to the new page without the fade effect.
Below is the code related to it:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
HTML
<div id="fade">
Some content
<a href="page2.html"><button>Click me</button></a>
</div>
jQuery:
$("#fade").click(function(){
$("#fade").fadeOut("slow");
});
Thank you.