Disable loading animation masonry infinite scroll

試著忘記壹切 提交于 2019-12-23 01:43:21

问题


I'm trying to disable the annoying animation of the loading #infsrc-loading container. Take a look at the infinite scroll demo here 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. 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. I looked at the source of both Masonry and InfiniteScroll and still can't tell where this setting is being set. I have disabled animations in Masonry as well.

I'm using the WordPress plugin if that helps.


回答1:


I found the piece of code. It's on line 155 of Infinite Scroll. I just changed show to fadeIn to make it work how I needed it.




回答2:


Maybe some of this isn't necessary, but works for me:

<style>
  #infscr-loading { display:none; }
</style>

For initialization of infinitescroll, set these options:

loadingImg : "",
loadingText : "",
loading: {
    finishedMsg: "",
    msgText: "",
    img: "" }

Update: The last line here hides the blue animated progress bar 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 :-)



来源:https://stackoverflow.com/questions/14866227/disable-loading-animation-masonry-infinite-scroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!