jQuery Carousel错误 [英] jQuery Carousel error

查看:148
本文介绍了jQuery Carousel错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的JavaScript代码:

$("#carousel").jCarouselLite({
    visible: 4,
    btnNext: ".next",
    btnPrev: ".prev",
    circular: false
});

为什么会出现此错误?

Why do i get this error?

Uncaught TypeError: Cannot read property 'offsetWidth' of undefined
widthjcarousellite_1.0.1.min.js:1
$.fn.jCarouselLitejcarousellite_1.0.1.min.js:1
e.extend.eachjquery.min.js:16
e.fn.e.eachjquery.min.js:16
$.fn.jCarouselLitejcarousellite_1.0.1.min.js:1
(anonymous function)home.js:4
f.extend._Deferred.e.resolveWithjquery.min.js:16
e.extend.readyjquery.min.js:16
c.addEventListener.B

推荐答案

好,我可能已经找到您的问题,可能与ASP有关.

Ok, I may have found your problem, it's probably ASP related.

更改语言后,<div id='carousel'>中的<ul>中没有任何元素.我几乎可以肯定,这会导致Carousel失败.请确保以下代码:<asp:Repeater runat="server" ID="Repeater_Videos">始终返回元素,然后重试.

When the language is changed, there are no elements in the <ul> in <div id='carousel'>. I'm almost certain that this is causing Carousel to fail. Please make sure this code: <asp:Repeater runat="server" ID="Repeater_Videos"> always returns elements, and then try again.

这篇关于jQuery Carousel错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆