- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经实现了一个可以正常工作的无限轮播,但我现在收到以下错误消息
对象 # 没有方法 'carouFredSel'
我已经为现在可以使用的菜单编辑了一些代码,但也许这两个脚本之间存在冲突?
http://www.ogormanconstruction.co.uk/basingstoke-treatment-works
Javascript:
<script type="text/javascript">
jQuery(document).ready(function() {
var imgLength = jQuery('ul#fredsel img').length;
jQuery('#totalImg').html(imgLength);
jQuery('#imgCount').html(1);
// Using custom configuration
// Using custom configuration
jQuery("#fredsel").carouFredSel({
items: 1,
align: false,
auto: false,
width: 1500,
scroll : {
items : 1,
duration : 1000,
pauseDuration : 2000
},
prev: {
button : "a.prev-slide",
onBefore : function() {
var theCount = parseInt(jQuery('#imgCount').html());
if (theCount === 1){
var theLength = jQuery('ul#fredsel img').length;
jQuery('#imgCount').html(theLength);
} else {
jQuery('#imgCount').html(theCount-1);
};
},
},
next: {
button : "a.next-slide",
onBefore : function() {
var theLength = jQuery('ul#fredsel img').length;
var theCount = parseInt(jQuery('#imgCount').html());
if (theCount === theLength){
jQuery('#imgCount').html(1);
} else {
jQuery('#imgCount').html(theCount+1);
};
},
}
})
.find("li").click(function() {
jQuery("#fredsel").trigger("slideTo", [jQuery(this)]);
}).css("cursor", "pointer")
});
</script>
CSS:
<div class="infinite-carousel">
<ul id="fredsel">
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-1.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-2.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-3.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-4.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-5.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-6.png"></li>
<li style="width: 600px"><img src="/wp-content/themes/child/images/basingstoke/basingstoke-7.png"></li>
</ul>
</div>
<div class="controls">
<a href="#" class="prev-slide"></a>
<a href="#" class="next-slide"></a>
</div>
最佳答案
看来您要多次添加 jQuery(以及其他脚本),carouFredSel 被覆盖了。
关于javascript - 对象 #<Object> 没有方法 'carouFredSel',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8732253/
我正在使用这个滚动条 http://coolcarousels.frebsite.nl/c/2/ 我在下面有这个设置。 我的问题是我将它设置为 visible: 4我有 4 张图片,所以它不会滚动。如
我在使用轮播时遇到问题。我想向轮播添加暂停或停止事件。我已经构建了一个 slider ,在左侧有一个 slider 的导航页面。 slider 自动启动,如果我手动选择幻灯片,我希望它停止 这是我的代
我有一个水平滚动轮播: _gotoNext: function (that) { //tjobbe - put funciton here to check if there
我在我的网站中使用 caroufredsel,我只希望它在窗口宽度小于 960px 时激活/工作。好的时候它可以工作,我调整浏览器窗口的大小,当它小于 960px 时它开始工作,但问题是当我再次调整窗
我以非常基本的方式使用 carouFredsel 插件 - 4 张带有副本的幻灯片,侧面有 4 个选项卡作为幻灯片之间的“导航”。该插件具有内置分页功能,可自动使用数字 1-x 构建分页作为您可以单击
我正在使用 CarouFredSel 来设计一个网站,但是我遇到了一个问题...一切都按预期工作,直到我尝试将图像链接到网址。 脚本看起来像: $(function() { /* Homepa
我将此代码与 CarouFredSel 一起使用,它工作正常,现在我想让它淡出而不是从左到右滑动。 jQuery(document).ready(function($) { $("#slide
我正在尝试向 carouFredSel 中的当前幻灯片添加一个“事件”类,但我无法让它工作。我最接近它的工作方式是使用 trigger("currentVisible") 在第一张幻灯片上添加它,但它
我正在尝试向 CarouFredsel 滚动条添加分隔符。最简单的方法是为每个元素添加右边框,但您是否可以看到最后一项中存在错误。关于我该怎么做的任何好主意?问题是插件的计算不允许我通过边距或填充甚至
我正在考虑让我现有的旋转木马响应,我有分页并且它显示所有页面,但是,它包含很多页面,所以当我尝试将它放入较小的屏幕时,数字会排到第二行。我还有下一步和后退按钮。 我想要的是能够显示,例如,从1到5的数
我将 CarouFredSel 用于图像轮播,但我在元素之间的过渡方面遇到了问题。 我想在轮播中使用一些简单的 HTML 而不是普通的旧图像,但是当我这样做时,滑动过渡不起作用。当旧图像滑出时,新图像
我正在设置一个简单的 carouFredSel,并且得到了奇怪的效果。 HTML:
经过数周的尝试,我终于让我的 caroufredsel 轮播以计算机为中心,却发现它仍然无法在移动设备(智能手机和平板电脑)上运行。请任何人帮忙。 网址是http://www.suffolkwindo
我遇到了 caroufredsel 的问题我在 Asp.net Webforms 中使用的 jquery carousel 插件。在我调整窗口大小之前,轮播不会显示。我可以在最新版本的 Google
我正在为响应式网站构建一个 caroufredsel(只有 3 个状态:960px、720px 和 320px)。当您以这些状态之一加载页面时,效果很好。它显示正确的项目数(分别为 3、2 和 1)。
我想突出显示当前项目,如何获取图像源和当前缩略图? http://jsfiddle.net/RL8MV/2/ $('#carousel span').append('');
我在使用 carouFredSel 时遇到响应式轮播的高度问题。 因为图像是响应式的,轮播也设置为响应式。 它仍然将图像的最大高度添加到 div。 当我的图像宽度为 740,高度为 960 时。它会将
我正在使用 carouFredSel创建垂直旋转木马。一切都很好,除了我更希望部分元素显示在底部,裁剪而不是隐藏。这样它会向用户表明还有其他可以滚动的元素。 我一直在阅读 documentation
我使用以下代码在一页上创建多个幻灯片。 幻灯片工作正常,但我无法让每个幻灯片的单独按钮工作。当我单击它们时,页面只会滚动到顶部。我认为通过唯一地标识每个链接,我应该不会有问题。 有什么问题吗?
这似乎很基本,但我找不到有关该主题的任何内容,我尝试查找 Advanced Documentation而这里却什么也没有。 当轮播更改图像以执行一些 DOM 操作时,我需要执行回调。有办法做到这一点吗
我是一名优秀的程序员,十分优秀!