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
Infinite Horizontal Scroll on Tumblr
提问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 上找到了一个:
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 height
s to width
s and the top
s to left
s. Sounds rather fiddly but worked like a charm.
我通过使用 Paul Irish 的无限滚动 jquery 插件并基本上将所有height
s更改为width
s 并将top
s更改为s 来针对我的主题之一执行此操作left
。听起来相当繁琐,但效果很好。