I have two pages:
index.php and external.php
in the index, I have the function:
$('#buttom').click (function (e) {
e.preventDefault ();
//click action
$('#ext-container').load('external.php');
});
And its ok, works fine. But I would like to hide the page before it is fully loaded.
I tried this on the external page:
**css**
#wrapper{
display:none;
}
$(window).load(function() {
$('#wrapper').fadeIn(2000);
});
but it only works when I open the page in normal browsing, using the load(external.php) the page keeps loading in stages.
Any ideas?
[UPDATE]
Fellows, using the tip of the TrueBlueAussie, the plugin waitForImages, worked like a charm.
Here is the solution:
in page index still the same, just load normaly.
$('#buttom').click (function (e) { e.preventDefault (); //click action
$('#ext-container').load('external.php');
});
now in external.php
script type='text/javascript' src='jquery.waitforimages.min.js'
important CSS:
#wrapper{
display:none;
}
$(document).ready(function(){
$('.wrapper').waitForImages(function() {
$(this).fadeIn(2000);
});
});
Ty all, will surely help many oders. Sorry my bad english!