Wednesday, 11 September 2013

Uncaught TypeError: Object [object Object] has no method 'cycle' in Wordpress Website

Uncaught TypeError: Object [object Object] has no method 'cycle' in
Wordpress Website

I don't know why I'm getting this error, I've added in the head the jquery
library (1.7.1) and in the footer the cycle plugin and my custom code.
<script src="<?php echo get_template_directory_uri();
?>/js/jquery.cycle.all.js"></script>
<script src="<?php echo get_template_directory_uri();
?>/sliders/nivo-slider/jquery.nivo.slider.js"></script>
<script src="<?php echo get_template_directory_uri();
?>/js/general.js"></script>
Inside general.js I have the following:
if($('.testimonials').length) {
function onAfter(curr, next, opts, fwd) {
var $ht = $(this).height();
$(this).parent().animate({height: $ht});
}
$('#testimonial-slider').cycle({
fx: 'fade',
timeout: 8000,
height: 'auto',
pause: 1,
before: onAfter,
cleartypeNoBg: true
});
}
I've even tried to just wrap that in a <script></script> tag just incase
there was something else in general.js that was breaking it, but I've had
no luck...
This is for a wordpress website and I don't know why it's happening...

No comments:

Post a Comment