@jasondavies thanks, and that's great, but I'm looking for a more general solution that will also work with @raphaeljs.