Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created March 20, 2011 13:45
Show Gist options
  • Save Takazudo/878330 to your computer and use it in GitHub Desktop.
Save Takazudo/878330 to your computer and use it in GitHub Desktop.
lazy alpha png background wrapper for fucking ie6
/* author:Takazudo */
$.fn.alphaBg = function(options){
return this.each(function(){
var src = options.src;
var $el = $(this);
if(!$.browser.ie6){
$el.css('background-image', 'url(' + src + ')');
}else{
$el.css('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='fixed', src='" + src + "')");
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment