Turn function into a jQuery plugin.