[英]Disable loading animation masonry infinite scroll
I'm trying to disable the annoying animation of the loading #infsrc-loading
container. 我正在尝试禁用加载#infsrc-loading
容器的恼人动画。 Take a look at the infinite scroll demo here http://masonry.desandro.com/demos/infinite-scroll.html . 在http://masonry.desandro.com/demos/infinite-scroll.html上查看无限滚动演示。
The first time the loading div appears it's static but after that when it loads more content is has an animation, like it appears from the bottom and grows. 第一次加载div出现时它是静态的,但在此之后加载更多内容时会有一个动画,就像它从底部出现并增长一样。 I want to disable this, but I couldn't find where this is being set. 我想禁用它,但我无法找到它的设置位置。
I tried disabling CSS transitions and $('#infsrc-loading').show()
in the plugin's callback. 我尝试在插件的回调中禁用CSS转换和$('#infsrc-loading').show()
。 I looked at the source of both Masonry and InfiniteScroll and still can't tell where this setting is being set. 我查看了Masonry和InfiniteScroll的来源,但仍无法分辨出这个设置的位置。 I have disabled animations in Masonry as well. 我也在砌体中禁用了动画。
I'm using the WordPress plugin if that helps. 如果有帮助,我正在使用WordPress插件。
I found the piece of code. 我找到了这段代码。 It's on line 155 of Infinite Scroll . 它位于Infinite Scroll的第155行 。 I just changed show
to fadeIn
to make it work how I needed it. 我只是将show
更改为fadeIn
以使其工作如何我需要它。
Maybe some of this isn't necessary, but works for me: 也许其中一些没有必要,但对我有用:
<style>
#infscr-loading { display:none; }
</style>
For initialization of infinitescroll, set these options: 要初始化infinitescroll,请设置以下选项:
loadingImg : "",
loadingText : "",
loading: {
finishedMsg: "",
msgText: "",
img: "" }
Update: The last line here hides the blue animated progress bar gif. 更新:这里的最后一行隐藏了蓝色动画进度条gif。
I'm using this version: 我正在使用这个版本:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
If you can improve my answer, feel free to correct me :-) 如果你能改进我的答案,请随时纠正我:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.