/** * @author Terry Wooton * @desc Adds a background layer to an element * @version 1.1 * @example * $("#element").add_background("url('/test.gif') bottom left no-repeat"); * @license free * @param background css * */ $(document).ready(function() { $.fn.add_layer = function(bg,params) { $(this).each(function() { s = $(this).extend({},params || {}); $last = ($(this).find('.add_background:last').length > 0 ? $(this).find('.add_background:last') : $(this)); $last.html('