javascript Tumblr 上的无限水平滚动

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7297316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 23:38:33  来源:igfitidea点击:

Infinite Horizontal Scroll on Tumblr

javascriptjquerytumblrinfinite-scroll

提问by Gaby

I'm not sure if any of you are familiar with Tumblr but I'm simply trying to attain a HORIZONTAL infinite scroll. Vertical infinite scrolls are easy to find.

我不确定你们中是否有人熟悉 Tumblr,但我只是想实现水平无限滚动。垂直无限卷轴很容易找到。

Now, I did find one on jsfiddle:

现在,我确实在 jsfiddle 上找到了一个:

jsfiddle.net/URCwd/20

jsfiddle.net/URCwd/20

Unfortunately, I don't know how to incorporate it into the Tumblr HTML.

不幸的是,我不知道如何将它合并到 Tumblr HTML 中。

Can someone please help me?

有人可以帮帮我吗?

回答by jeffreydev

Do you mean something like this:

你的意思是这样的:

$(document).ready(function() {  
    $(window).scroll(function() {
        if ( $(window).scrollLeft() >= ($('body').width() - $(window).width()) ) {
            $('body').width('+=100');
        } 
    });
});

回答by Charlotte Dann

I did this on one of my themes by using Paul Irish's infinite scroll jquery plugin and essentially changing all the heights to widths and the tops to lefts. Sounds rather fiddly but worked like a charm.

我通过使用 Paul Irish 的无限滚动 jquery 插件并基本上将所有heights更改为widths 并将tops更改为s 来针对我的主题之一执行此操作left。听起来相当繁琐,但效果很好。