Question

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...

Was it helpful?

Solution

The issue was fixed by removing the default jQuery library as indicated by eclanrs

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top