Last active
January 29, 2018 11:49
-
-
Save KaiserEMP/ea2b4438c0a7c3d808ad4462827e30fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ( ! Modernizr.objectfit ) { | |
| $('.eda-module-type-social .tab_content_inner div a[rel="instagram-feed"]').each(function () { | |
| var $container = $(this), | |
| imgUrl = $container.find('img').prop('src'); | |
| if (imgUrl) { | |
| $container | |
| .css('backgroundImage', 'url(' + imgUrl + ')') | |
| .addClass('compat-object-fit'); | |
| } | |
| }); | |
| } | |
| .eda-module-type-social .tab_content .tab_content_inner div a[rel="instagram-feed"] { | |
| width: 100%; | |
| height: 270px; | |
| display: block; | |
| margin-bottom: 12px; | |
| img { | |
| width: 100vh; | |
| height: 270px; | |
| object-fit: cover; | |
| } | |
| &.compat-object-fit { | |
| background-size: cover; | |
| background-position: center center; | |
| background-repeat: no-repeat; | |
| img { // hide image if object fit is not supported - opacity to 0 for the link area | |
| opacity: 0; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment