Gilding the Gallery 3: Ajaxifying the filterable gallery

Last time we set up the PHP (slash HTML, slash CSS) to dynamically generate Media Library Assistant gallery shortcodes and an album menu. Everything works without any JavaScript. Today we’re going to add JavaScript, with jQuery, to do three things.

  1. Hide the album menu under a button, a la a mobile menu.
  2. Use AJAX to reload only the portion of the page containing the gallery.
  3. Push each new URL into the browser history, so that the back button works and individual albums can be bookmarked.