infinite-scroll

Angular 4 with ngx infinite scroll

旧城冷巷雨未停 提交于 2019-12-03 09:02:30
I am trying to add an infinite scroll with ngx-infinite-scroll in my Angular 4 project. The array data has about 800 posts which are from API. Initially, I want to display 20 posts and every single time the page is scrolled, it will display 20 more posts. Currently, I can see the console log message (scrolled!) whenever I scroll down. But I can't figure out how to append 20 posts into the table when it's scrolled. This is the codes that I am trying. onScrollDown function onScrollDown(){ this.dataService.getPosts().subscribe((posts)=>{ for (let post of posts){ let data = '<tr><td>'+ post.title

Getting Infinite-Scroll by paulirish to work on iPhone

允我心安 提交于 2019-12-03 08:58:15
I've been implementing Infinite-Scroll by Paul Irish on my site. It works on desktop browsers, but on mobile (iPhone specifically) it doesn't straight away. The work around is zooming in slightly, that makes the scroll event fire which triggers infinite scroll. Also see the issue report here: https://github.com/paulirish/infinite-scroll/issues/3 My question is: is there a solution for this? I've noticed Tumblr makes infinite-scroll work without a workaround. If you were to check http://youworkit.tumblr.com/ on iPhone, then switch from the mobile to the standard desktop view, infinite-scroll

What is the correct way to implement infinite scroll in knockout?

别等时光非礼了梦想. 提交于 2019-12-03 06:30:12
I have an array of articles in my Model and they are rendered nicely as HTML. What I want is to add some new articles when the user scrolls to the end of the page. I achieved this, but in my opinion with some really hacky behavior: all I have done is added jquery event handler $(window).scroll , like this: function ArticlesViewModel() { var self = this; this.listOfReports = ko.observableArray([]); this.loadReports = function() { $.get('/router.php', {type: 'getReports'}, function(data){ self.listOfReports(self.listOfReports().concat(data)); }, 'json'); }; this.loadReports(); $(window).scroll

Infinitely scrolling in both directions of UICollectionView with sections

早过忘川 提交于 2019-12-03 04:04:32
问题 I have a month view similar to the iOS calendar and an UICollectionView is used. Now it would be interesting to implement an infinite scrolling behavior so that the user can scroll in each direction vertically and it will never end. The question now is how can such a behavior be implemented in an efficient way? This is what I've found out now: Basically you can check if you hit the end of the current scroll view. You can check this in scrollViewDidScroll: or in collectionView

Infinite Scroll Without External Content

一个人想着一个人 提交于 2019-12-02 21:52:52
问题 I am creating a blog in which I want more posts to load when the user scrolls to the bottom of the page. However, I do not want to use a jQuery plugin that pulls the content from another .html file. Instead I want to put all of the posts on one page and limit the amount that are visible then load a couple more as the user keeps scrolling down. Are There any plugins or snippets that could help me achieve this? Example: <-- Visible to users --> <article> Pretend this is a preview for an article

imagesLoaded method not working with JQuery masonry and infinite scroll

夙愿已清 提交于 2019-12-02 21:11:00
I've been using JQuery masonry and now I'm adding infinite scroll. There are images in nearly every masonry "brick" and before I was using infinite scroll the images loaded fine and everything was great. I added the next part of the javascript for the infinite scroll and added the imagesLoaded method inside but when the new bricks are appended they come out all piled on top. My assumption is that I am not adding the imagesLoaded method properly in the infinite scroll callback but I haven't been able to find my error. Here's the code <script type="text/javascript"> $(function(){ var $container

Implementing Infinite Scrolling with jquery

孤街浪徒 提交于 2019-12-02 21:05:11
I am working on a project that uses the jQuery Masonry and Infinite Scroll plugins to load "n" amount of pictures from instagram using their API. Looking at this short example my understanding is that I need to have before hand the html pages to be rendered: <nav id="page-nav"> <a href="pages/2.html"></a> </nav> The problem is, I dont really know how many pictures will be retrieved. Here is for example how I retrieve 20 pics at a time. $(document).ready(function(){ var access_token = location.hash.split('=')[1]; if (location.hash) { $.ajax({ type: "GET", dataType: "jsonp", cache: false, url:

jQuery click won't work with new infinite scroll elements

旧街凉风 提交于 2019-12-02 17:41:45
问题 On my page, I have a list with items and you can click on a "View More" button which shows you more information about this topic. This click function is in jQuery on an other page. I've implemented an infinite scroller on this page, but now the button "View More" doesn't work on the new elements, only on the first element. FYI: I didn't code this application, my task is just to add the infinite scroll. I've searched the web about this issue and I've read a few times this might be because the

Infinitely scrolling in both directions of UICollectionView with sections

左心房为你撑大大i 提交于 2019-12-02 16:25:29
I have a month view similar to the iOS calendar and an UICollectionView is used. Now it would be interesting to implement an infinite scrolling behavior so that the user can scroll in each direction vertically and it will never end. The question now is how can such a behavior be implemented in an efficient way? This is what I've found out now: Basically you can check if you hit the end of the current scroll view. You can check this in scrollViewDidScroll: or in collectionView:cellForItemAtIndexPath: . It would be simple to add another content to the datasource, but I think there is more than

jQuery Infinite Scroll - event fires multiple times when scrolling is fast

允我心安 提交于 2019-12-02 15:16:41
Okay, the code below "works" in that when you scroll to the bottom of the page the AJAX function is fired and results are appended to the #postswrapper div on the page. The issue is: if I scroll really quickly when I reach the bottom of the page, the AJAX fires several times and loads several sets of results into the #postswrapper div (number of additional, 'unwanted' results are determined by how many additional scroll events were fired by scrolling quickly). Ultimately, I need only serve one set of results per time the user reaches the bottom. I've tried adding timers and such, but to no