jQuery Roundup: 1.5.2, Waypoints, Sausage

05 Apr 2011 | By Alex Young | Tags jquery plugins

jQuery 1.5.2 Released

jQuery 1.5.2 was released on March 31st, just as planned. Who says IT projects are late and over-budget?! This release includes 18 bug fixes.

jQuery Waypoints

jQuery Waypoints (GitHub: imakewebthings / jquery-waypoints, MIT/GPL) by Caleb Troughton triggers a function when scrolling reaches an element. This could be used to create infinite scrolling, sticky elements, and even scrolling analytics).

Waypoints works by applying a callback to an element:

$('.entry').waypoint(function() {
  alert('You have scrolled to an entry.');
});

Sausage

Sausage (GitHub: christophercliff / sausage) by Christopher Cliff is a jQuery UI widget for presenting context alongside infinite scrolling pages. There’s a nice example of Sausage showing CouchDB documentation, with section annotations along the right-hand-side.

That example uses this JavaScript:

$(window)
    .sausage({
        content: function (i, $page) {
            return '<span class="sausage-span">'
                + $page.find('.anchor').first().text()
                + '</span>';
        }
    });

Each section of text in the CouchDB documentation is wrapped with an element with a class of page, so the $page part would really look like this: $('.page').find('.anchor').first().text(). That lets Sausage find the title of each section to use for its navigation.


blog comments powered by Disqus