我在这个页面上放了一个常见的花园式循环幻灯片:http://www.orientalhealthsolutions.com/index-new。由于某些原因,图像不会像我的测试配置中那样重叠:http://www.orientalhealthsolutions.com/cycle.html
下面是html:
<div class="slideshow">
<img src="/photos/slideshow-1.jpg" alt="slideshow-1" width="600" height="410" />
<img src="/photos/slideshow-2.jpg" alt="slideshow-2" width="600" height="410" />
</div>下面是jQuery:
$('.slideshow').cycle({
fx: 'fade'
}); 下面是CSS:
.slideshow {
width: 600px;
height: 410px;
overflow: hidden;
}我收到一条错误消息,指出$不是一个函数,所以我要么有冲突,要么搞乱了其他东西。任何指导-指导都将不胜感激。
谢谢。
发布于 2012-04-13 22:43:05
是啊,看起来你好像和什么事有冲突。
在chrome中:console.log($)是未定义的,而as console.log(jQuery)是有效的。
快速修复将$('.slideshow')更改为jQuery('.slideshow')
https://stackoverflow.com/questions/10142821
复制相似问题