dio-v
2/22/2016 - 12:40 PM

object-fit cover fix.js

    //IE/EDGE object-fit: cover; fix
    if ('objectFit' in document.documentElement.style === false) {
        $('.ratio').each(function () {
            var vT = $(this);
            vImg = vT.find('img').first().css('visibility', 'hidden').attr('src');
            vT.css({
                'background-image': 'url(' + vImg + ')',
                'background-size': 'cover',
                'background-position':'center center'
            });
        });
    }