Reputation: 1
I'm using preloadme
script to fadeOut
my preloader div
on window.load
but I'm wondering if instead of waiting for the whole entire page to load I can target one specific div:
preloadme
code
$(window).load(function() {
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
$('body').delay(350);
})
my idea that doesn't work
$('#img-container').load(function() {
Any suggestions greatly appreciated
Upvotes: 0
Views: 528
Reputation: 3520
I am afraid its not possible, since you can access the page element
once DOM
is initialize.
just go with $(function(){ //your code})
, that will make your code run every time
$(function(){
$('#status').fadeOut(); // dont rely on this to hide the loaded, use css below
$('#preloader').delay(350).fadeOut('slow');
});
You can do this using CSS, to initially show the preloaded till page loads
#preloader {display:block}
Upvotes: 1