I have a simple one-page parallax site. Each section template is populated by a document, and each section has a button that when clicked auto scrolls to the next section. I’m having a problem targeting the next section. I have the doc _id as the id attribute for the sections but how do I get the next one dynamically?
For example if this is my button markup within my template, this is what I’m trying to get:
@proyb2 Can’t imagine your solution. Please, show an exampe, because I had relevant issue and solved with skip and limit - but it is not really optimal way.
I follow this tutorial on adding new schema using autoform which could be applicable to adding new fields for “categories” as IT…Business…Financial and “documentindex” as 1…2…3…4…5. Safer and good housekeeping.
_id is a random alphanumeric so the threadstarter of this question can’t retrieve the next documents in sequence order.
@proyb2 Got it! But using {sort: [<my custom sort>]} for query brokes that kind of logic. Moreover this way you have to publish documentindex for the client.
Thanks everyone for the response. In the end I solved it by streamlining my DOM and using jQuery to find the next target to scroll to. I had another use for this but in that instance using fullpage.js solved my problems.