Image ObjectFit for IE browser
Sun Sep 24 2023 12:59:33 GMT+0000 (Coordinated Universal Time)
Saved by
@sagarmaurya19
// for IE browser - object fit property
if ('objectFit' in document.documentElement.style === false) {
$('.rec-post-wrap img.hs-featured-image').each(function(){
var w = $(this).width();
var h = $(this).height();
var s = $(this).attr('src');
var final = 'data:image/svg+xml,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' width=\'' + w + '\' height=\'' + h + '\'%3E%3C/svg%3E';
$(this).css('background','url('+s+') no-repeat 50% center \/cover');
$(this).attr('src',final);
});
}
content_copyCOPY
Comments