Skip to content

Instantly share code, notes, and snippets.

View clarabstract's full-sized avatar

Clara clarabstract

  • Klei Entertainment
  • Vancouver, BC
View GitHub Profile
@clarabstract
clarabstract / example.js
Created February 8, 2012 18:37 — forked from gnarf/example.js
$.fn.newContent
// $.fn.newContent behaves kinda like .live(), it will act on elements that match the
// selector now, or in the future... It automatically runs on any elements immediately
// matched, and also runs once on document ready. You then call .newContent() on any
// freshly created content to trigger searching it
// It will call the given callback function in the context of a
// jQuery set that matches the selector...
$("li.test").newContent(function() {
this.css("color", "red");