Jquery 工具 - 可滚动、循环 - 徽标排列的问题,徽标不会重新出现,直到显示最后一个徽标

发布于 2024-09-12 14:07:15 字数 1404 浏览 1 评论 0原文

我遇到了 jquery 工具/可滚动插件的问题。

使用circular:true 选项,在此页面上: http://oda.sanscode.com/

显示的徽标排列只会克隆最后一个徽标时的徽标已达到。这会在显示最后一个徽标和复制第一个徽标的时间之间留下明显的间隙。

我需要改变圆形背后的逻辑,以便不存在明显的间隙。

这是 jquery 工具插件的代码:

// circular loop
    if (conf.circular) {

                    //take the last item, prepend it to the itemWrap
        var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap),
             cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); //take the second item, place it after the itemWrap


        cloned1.add(cloned2).addClass(conf.clonedClass);

        self.onBeforeSeek(function(e, i, time) {


            if (e.isDefaultPrevented()) { return; }

            /*
                1. animate to the clone without event triggering
                2. seek to correct position with 0 speed
            */
            if (i == -1) {
                self.seekTo(cloned1, time, function()  {
                    self.end(0);
                });
                return e.preventDefault();

            } else if (i == self.getSize()) {
                self.seekTo(cloned2, time, function()  {
                    self.begin(0);
                });
            }

        });

        // seek over the cloned item
        self.seekTo(0, 0);
    }

有人可以帮助我吗?

谢谢

I am having an issue with jquery tools / scrollable plugin.

Using the circular:true option, on this page:
http://oda.sanscode.com/

The logo parade shown will only clone the logos when the last logo is reached. This leaves a visible gap between the time the last logo is shown and the first logo is replicated.

I need to change the logic behind circular so that there is no visible gap.

Here's the code from the jquery tools plugin:

// circular loop
    if (conf.circular) {

                    //take the last item, prepend it to the itemWrap
        var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap),
             cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); //take the second item, place it after the itemWrap


        cloned1.add(cloned2).addClass(conf.clonedClass);

        self.onBeforeSeek(function(e, i, time) {


            if (e.isDefaultPrevented()) { return; }

            /*
                1. animate to the clone without event triggering
                2. seek to correct position with 0 speed
            */
            if (i == -1) {
                self.seekTo(cloned1, time, function()  {
                    self.end(0);
                });
                return e.preventDefault();

            } else if (i == self.getSize()) {
                self.seekTo(cloned2, time, function()  {
                    self.begin(0);
                });
            }

        });

        // seek over the cloned item
        self.seekTo(0, 0);
    }

Can someone please assist me?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

死开点丶别碍眼 2024-09-19 14:07:15

jquery工具论坛上有人在这里发布了解决方案:
http://jquerytools.org/forum/tools/35/46918

Someone on the jquery tools forum posted a solution here:
http://jquerytools.org/forum/tools/35/46918

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文