So I have this so far:

In the <head> area:

  <script type="text/javascript" src="jquery.min.js"></script>
function hyperlink(url)
$( '#weather_infos' ).fadeOut(1000);
window.location.href = url;
In the <body> area:

<li><button onclick="javascript: hyperlink('index.php?page=months')">Months</a></li>
All I want to do is to fade out the main content in the div named "weather_infos" and then go to the page requested. But it executes all in one go. It does not wait for the animation to play out.

How to fix?

Thanks for reading.