jQuery Plugin Roundup: sqrop, At Intervals

09 Feb 2010 | By Alex Young | Tags jquery plugins

I want to start doing a semi-regular jQuery plugin roundup, seeing as readers often send us in their work. It’s like show and tell for grown ups! Contact us if you want your plugins featured.


jquery.sqrop is written by Jacek Becela and uses CSS to make neat image thumbnails. This uses the CSS clip property which is useful because you can cut down unwieldy user-submitted images.

Usage looks like this:

$(document).ready(function () {
  $("img").load(function () { $(this).sqrop(123) })

At Intervals

I noticed Jacek has also written At Intervals which provides a nicer API for window.setInterval:

$("#widget").at_intervals(fn, { delay: 3000, name: "poll_messages") // calls fn(), then 3s delay, then fn() again, etc..

It’s a simple plugin, but provides useful features like being able to pause execution:

$("#widget").data("poll_messages").should_pause = true  // pauses execution
$("#widget").data("poll_messages").should_pause = false // resumes execution  
$("#widget").data("poll_messages").should_stop  = true  // stops execution (calls clearInterval() internally)

blog comments powered by Disqus