I’m trying to make a paging functionality in a rss parser. It’s almost working. Only the last page is wrong. See fiddle here. The last page displays 11-10. Why is that? There are currently 10 items in the feed, so in this example there should be only two pages, not three – and on page number two, the “next” button should be hidden.
Is this where something is wrong?
if (numEntriesReturned+1-oRssConfig.contempOffset>0 && oRssConfig.contempOffset<100-oRssConfig.maxItems) $('#btnNext').css("display", "block");
else $('#btnNext').css("display", "none");
After many hours, I re-wrote the script completely. This should work to load & paginate the RSS feed using Zazar’s zRSSFeed plug-in. I commented most functions so you can see and understand whats going on, well, hopefully!
Features:
Easily choose ‘Feeds Per Page’ to display.
Easily enter the link to the RSS Feed.
Next & Previous Buttons appear/disappear when needed.
Displays Feed Count automatically on each page. Example: ‘1 of 5’
Check out this Fiddle to see it in action!
Any questions?
JQuery Script