Wouldn't $(document).ready... be better? Since JQuery will only run the code when the HTML (excluding images) of the page is finished loading.