Skip to content

Instantly share code, notes, and snippets.

@bradwright
Created March 4, 2009 16:26
Show Gist options
  • Save bradwright/73896 to your computer and use it in GitHub Desktop.
Save bradwright/73896 to your computer and use it in GitHub Desktop.
$(document).ready(function($) {
var toReplace = "/trans.gif";
$('img[src$=png]').each(function(i) {
var src = $(this).attr('src');
var styleBlock = {
'width': $(this).width() + 'px',
'height': $(this).height() + 'px',
'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
};
$(this).css(styleBlock);
$(this).attr('src', toReplace);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment