- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个水平滚动轮播:
_gotoNext: function (that) {
//tjobbe - put funciton here to check if there is anything else after the last slide, then stop / disable the gotonext. must only scroll one if only one is available (or 2). same for go to prev
that.$element.find('.mediaCarousel').trigger("next", false);
},
//This method tells the mediaCarousel to go to the previous slide.
_gotoPrev: function(that, callback) {
that.$element.find('.mediaCarousel').trigger("prev", false);
},
当到达最后一项时,我需要它停止或至少禁用下一个按钮。如果有非偶数,我也需要它只滚动一两个项目,或者让它滚动全部三个项目。
我当前的代码似乎没有关注内置的“infinite: true (or false)”选项。
例如,我现在有 7 个项目,我一次滚动 3 个。我想在第三个滚动时停止,以便第二个滚动仅按照列表中的项目进行。
如果这可能的话有什么想法吗?
最佳答案
好像有一个循环和一个无限选项可以设置。
我想其中之一会做你想要的(最有可能是无限的):
$('#carousel').carouFredSel({
circular: true, // Determines whether the carousel should be circular.
infinite: true, // Determines whether the carousel should be infinite. Note: It is possible to create a non-circular, infinite carousel, but it is not possible to create a circular, non-infinite carousel.
responsive: false, // Determines whether the carousel should be responsive. If true, the items will be resized to fill the carousel.
direction: "left", // The direction to scroll the carousel. Possible values: "right", "left", "up" or "down".
width: null, // The width of the carousel. Can be null (width will be calculated), a number, "variable" (automatically resize the carousel when scrolling items with variable widths), "auto" (measure the widest item) or a percentage like "100%" (only applies on horizontal carousels)
height: null, // The height of the carousel. Can be null (width will be calculated), a number, "variable" (automatically resize the carousel when scrolling items with variable heights), "auto" (measure the tallest item) or a percentage like "100%" (only applies on vertical carousels)
align: "center", // Whether and how to align the items inside a fixed width/height. Possible values: "center", "left", "right" or false.
padding: null, // Padding around the carousel (top, right, bottom and left). For example: [10, 20, 30, 40] (top, right, bottom, left) or [0, 50] (top/bottom, left/right).
synchronise: null, // Selector and options for the carousel to synchronise: [string selector, boolean inheritOptions, boolean sameDirection, number deviation] For example: ["#foo2", true, true, 0]
cookie: false, // Determines whether the carousel should start at its last viewed position. The cookie is stored until the browser is closed. Can be a string to set a specific name for the cookie to prevent multiple carousels from using the same cookie.
onCreate: null // Function that will be called after the carousel has been created. Receives a map of all data.
});
关于javascript - CarouFredSel - 关闭无限滚动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21253561/
我正在使用这个滚动条 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 操作时,我需要执行回调。有办法做到这一点吗
我是一名优秀的程序员,十分优秀!