Henry Finkelstein
Henry Finkelstein

Reputation: 3

jQuery Firefly effect not working in Wordpress

I am trying to implement a firefly effect on my Wordpress site.

When my designer created a static HTML site (http://fictiontech.net/cirko/) everything works just fine and the fireflies look great.

The I converted the site design to Wordpress (http://greenpeaklabs.com/cirko/) and now the fireflies don't appear anymore.

When I look in the console, it tells me that my initiating code:

<script>
  //firefly effect
  jQuery(document).ready(function() {
    $.firefly();
  });   
</script>

it tells me "Uncaught TypeError: undefined is not a function" even though it's the exact same initialization as on the static HTML site.

I've also found a Wordpress site where the firefly effect works just fine (yootheme.com/demo/wordpress/radiance)

I've hit my head against this wall for a number of hours now, trying to scour the interwebs for solutions as well as reviewing working code to try and back into the problem, but no luck. Any idea where the error is coming from and how I can make it work

Upvotes: 0

Views: 217

Answers (1)

kaarel
kaarel

Reputation: 617

As WordPress is running jQuery in no-conflict mode, the $ alias is not defined – you should change your function call to either:

jQuery(document).ready(function() {
    jQuery.firefly();
});

or

jQuery(document).ready(function($) {
    $.firefly();
});

Upvotes: 2

Related Questions