我正在使用以下代码将无序列表制作成带有 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 更新了语法。