Silvia Tacher
Silvia Tacher

Reputation: 109

Uncaught TypeError: on my preloader. How to make it work?

I have always used this code to preload the pages, now I was testing it with wordpress, but I generate the following error:

  Uncaught TypeError: Property '$' of object [object Window] is not a function

The file is attached to an external file. As you can see from the demo. What am I doing wrong? Thank you :)

Used previosly

LIVE LINK

$(window).load(function() { 
 $(".loader").delay(350).fadeOut("slow"); 
})

Upvotes: 0

Views: 135

Answers (1)

Pointy
Pointy

Reputation: 413846

You're calling jQuery.noConflict() from your modified copy of jQuery, so that unbinds the $ symbol.

If you're not using a conflicting library, there's no need to do that. If you remove that line, things will work. Alternatively you could wrap your preload code like this:

;(function($) {
  $(window).load(function() { 
    $(".loader").delay(350).fadeOut("slow"); 
  });
})(jQuery);

Upvotes: 1

Related Questions