Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery - error in jcarousel

I'm getting a Javascript error on the homepage of a site I've developed. On the homepage there is a jCarousel scroller to scroll between profiles.

The error is as follows:

this.clip[0] is undefined

On line 844 of jquery.jcarousel.js.

And the URL is http://www.professionalgirlfriends.co.uk - Excuse the subject matter, as it's an escort website.

Any idea what's up?

like image 308
Probocop Avatar asked Nov 17 '10 21:11

Probocop


2 Answers

Btw, I had the same problem, and it was I had div tags instead of ul tags:

like image 62
Luis R. Avatar answered Oct 20 '22 08:10

Luis R.


I actually just fixed it myself. The thing that was causing the issue is as follows:

In one of my Javascript files, I have the following code:

// Load jCarousel on homepage only
    if($('#home').length) {
        jQuery('.view-content').jcarousel();
    }

This code is there to load the jcarousel on just the homepage. The thing that was causing the issue is I wasn't being specific enough when I was triggering the jcarousel. In other words, there was more than one .view-content on the page.

I changed it to:

// Load jCarousel on homepage only
    if($('#home').length) {
        jQuery('#block-views-escorts-block_1 .view-content').jcarousel();
    }

All sorted now though!

Thanks

like image 23
Probocop Avatar answered Oct 20 '22 08:10

Probocop