Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Force load #6

Closed
softshape opened this Issue · 5 comments

3 participants

@softshape

There's a case where "show more" link should be displayed, but when user clicks on it the script should load next page by AJAX. This can be implemented two ways -

1) Adding some class name to the link which says "don't hide me" and processing the click as it usually process scrolling.
2) Implementing "force next page load" function available from the page's JavaScript, then developer can call it from his own code.

Is there support of any way (or may be any other way) to make force load currently?

@fieg
Owner

So basically you want the next page be loaded after the user clicks a link, instead of automatically when you user scrolls down?

@softshape

Exactly. Not always, but for links marked by some class or any other way. As real case, I'd make 7 pages with usual links and on 8th put this marked link. If user clicks on it, then 7 more pages with auto-scroll and stop on 8th, etc.

@fieg
Owner

I have plans to add more event handlers to IAS which would allow for more customization. Also, I like your idea to have an option to goto the next page after clicking a link. But I don't think it will implemented anytime soon.

@fieg
Owner

@softshape you might want to have a look at the onLoadItems callback I added today. I think you can use it to make the functionality you were looking for.

What you probably want to do is:

  1. store the items retrieved via the onLoadItems callback in a temporary variable
  2. return false in the callback to prevent automatic insertion of the items by IAS
  3. insert the items manually onclick of the link
@fieg fieg closed this
@mplungjan

I think the asker is looking at Google image search - it continuously scrolls for a few pages, then at a certain stage it shows "Load more images" instead of scrolling - when you click on that, the infinite scroll continues - in their case till end, but I suggest to give a parameter of pages or number of records to allow before showing the link again. It is not convenient to store the next page in a var, but simply have a number of records to show before stopping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.