Created
March 4, 2009 16:26
-
-
Save bradwright/73896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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