Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Michael Strand
Michael Strand
10,897 Points

Responsive Pagination

I am wondering if anyone would have an idea as to accomplishing a responsive pagination like SmugMug's gallery. As the screen size changes it is updating the next and pervious buttons URLs and also updating the page count based on how many images are displayed.

I am working with WordPress to build the gallery.

Here is an example of the gallery. https://derekbaune.smugmug.com/Hunting/

1 Answer

Steven Parker
Steven Parker
229,968 Points

This could be done in JavaScript.

I would imagine that a handler for the page resize event would recalculate the layout and update the controls. This is quite likely what your sample site is doing. Also, at first glance it appears to be using some version or derivative of the YUI Library.

Now perhaps someone more familiar with Wordpress will chime in, but from my limited understanding Wordpress might not be easily adapted to this kind of functionality unless you're prepared to develop your own theme.