I have a page where a PDF is embedded and I'm using a preloader. In Firefox works perfectly, but in Chrome or Safari doesn't. The preload text and image stays only for a second, after that a grey screen appears and stays till the file is loaded.
Here is my code:
<body>
<div id="loading">
<div class="pretxt">Please be patient, you won't regret!</div>
<div class="preimg">
<img src="path/to/image/loader.gif" width="126" height="22" alt="Loading..." />
</div>
</div>
<embed src="/path/to/file/pdf.pdf" width="100%" height="100%" alt="pdf" id="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(window).load(function()
{
$("#loading").fadeOut("slow");
});
</script>
</body>
Can you please give some advices? Thank you!