Last active
August 29, 2015 14:03
-
-
Save nowri/6391cd2fdf292eda84a1 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
// img elems | |
if(typeof window.addEventListener == 'undefined' && typeof document.getElementsByClassName == 'undefined') { | |
$('img').each(function() { | |
var $this = $(this), | |
src = $this.attr('src'); | |
if(src.indexOf('.png') != -1) { | |
$this.css({ | |
'filter': 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '", sizingMethod="scale");' | |
}); | |
} | |
}); | |
} | |
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
<!--[if IE 8]> | |
<script> | |
// CSS background | |
$(function () { | |
var exp = /url\(["']*(.*?)["']*\)/; | |
$(".pngfix").each(function (i, el) { | |
var $this = $(this), | |
src = $this.css("background-image").replace(exp, "$1"); | |
$this.css({ | |
backgroundImage: "none", | |
filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')" | |
}); | |
}); | |
}); | |
</script> | |
<![endif]--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment