/* Class: dwIMageProtector Author: David Walsh Website: http://davidwalsh.name Version: 1.0.0 Date: 08/09/2008 Built For: jQuery 1.2.6 */ jQuery.fn.protectImage = function(settings) { settings = jQuery.extend({ image: 'http://kir016279.kir.jp/js/blank.gif', zIndex: 10 }, settings); return this.each(function() { var position,height,width,par = null; var position = $(this).position(); var height = $(this).height(); var width = $(this).width(); var par = $(this).parent(); $(this).css("z-index","1"); $('').attr({ width: width, height: height, src: settings.image }).css({ border: '0px none', top: position.top, left: position.left, position: 'absolute', zIndex: settings.zIndex }).appendTo(par) }); };