SCSS Framework

Added modernizr script to image Cover example
Added Aspect Ratio variables
Fixed image->fit aspect ratio to w/h instead of h/w
Added impotrant to width/height in image ->cover

TODO vertical center mixin
This commit is contained in:
2017-05-03 10:00:51 +02:00
parent d720639d65
commit 787bd61ce6
22 changed files with 1515 additions and 27 deletions
+24
View File
@@ -0,0 +1,24 @@
/**
* Created by Simon on 28.04.2017.
*/
function modernizeObjectFit($selector) {
// Object-fit
if (!Modernizr.objectfit) {
jQuery($selector).each(function () {
var $container = jQuery(this),
imgUrl = $container.find('img').prop('src');
if (imgUrl) {
$container
.css('backgroundImage', 'url(' + imgUrl + ')')
.addClass('compat-object-fit');
}
});
jQuery($selector + " img").each(function () {
jQuery(this).css('opacity', '0');
});
}
}