MyBB Community Forums

Full Version: Arrow key pagination navigation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
use arrow keys to scroll through pages on any page with the pagination
The problem I could see with that is if you need to scroll, you would be forced to use a mouse or page down. It'd really depend on the theme's CSS and how it treats content that stretches your screen.
If it was the left and right ones that shouldn't interfere with scrolling.
Pretty simple to accomplish. Determine the page ID for the current thread, upon hitting the right arrow key increment that number by one and redirect. Similar concept for going back a page.
https://github.com/faviouz/mybb-keyboard-navigation

I haven't touched it in a long time and it's a total WIP, but I think it works at the moment. Either way I'd like to rewrite it, specifically the JavaScript for which I will use jQuery instead in preparation for 1.8.

Could be worth doing something similar for 2.0. Or perhaps just drop the whole concept of pagination and implement endless scrolling (while gracefully degrading to pagination links of course).
(2013-01-01, 03:22 PM)Fábio Maia Wrote: [ -> ]https://github.com/faviouz/mybb-keyboard-navigation

I haven't touched it in a long time and it's a total WIP, but I think it works at the moment. Either way I'd like to rewrite it, specifically the JavaScript for which I will use jQuery instead in preparation for 1.8.

Could be worth doing something similar for 2.0. Or perhaps just drop the whole concept of pagination and implement endless scrolling (while gracefully degrading to pagination links of course).

On large boards endless scrolling is not good because that is a ton of data it'd have to cache. If you use something like LIMIT x, y it still has to scan the full table which can be noticable in large boards. If you could somehow write it to just use LIMIT x and use another field to offset it like lastposttime, it might work as long as LIMIT is not overly large.
Couldn't you just use AJAX to pull them on an as-needed basis?
Yeah, but if you use LIMIT x, y it still has to scan the whole table. It just throws out records that aren't in the parameters.
Ah, I get it now, well that sucks. How does pagination avoid this (It still lists how many pages a thread has, so it must at least be counting the table rows, right?).

[/SQLnub]
I don't think that pagination in threads and forum listings should die tbh, there's very good reasons to want these separated by pages.
Pages: 1 2 3