1

我正在使用以下代码将无序列表制作成带有 jcarousel lite 和 jquery 的轮播:

<?php echo $this->Html->script(array('jquery-1.4.2.min','jquery.easing.1.1','jcarousellite_1.0.1.pack','jquery.mousewheel.min'), array('inline' => false)); ?>

    <?php echo $this->Html->scriptStart(array('inline' => false)); ?>
        $(document).ready(function() {
            $(".mouseWheelButtons .jCarouselLite").jCarouselLite({
                btnNext: ".mouseWheelButtons .next",
                btnPrev: ".mouseWheelButtons .prev",
                mouseWheel: true,
                circular: false,
                start: 0,
                visible: 5,
                easing: "easein"
            });
        });
    <?php echo $this->Html->scriptEnd(); ?>

但是,我在 firebug 中收到以下 javascript 错误:

a[0] is undefined

有谁知道是什么导致了错误。
我正在使用 jcarousel lite 的打包版本。

问题是代码在 cakephp 1.2 中工作,但现在我使用的是 1.3,并且我已经使用 scriptstart、scriptEnd 和 Html->script 更新了语法。

4

2 回答 2

1

div的引用 id 或类必须是ul标记的直接父级

脚本

$('.rssBody').jCarouselLite({
       auto: 800,
       speed: 1000
    });

html

<div class="rssBody">
    <ul>
        <li>text</li>
    </ul>
</div>
于 2011-08-04T05:43:10.197 回答
1

好的,我发现出了什么问题。我似乎所有错误都比最初看起来更简单。

一切都设置得很完美,但是我忘记了包含列表项标签。:)

于 2010-03-28T17:10:57.783 回答