Polyfills

Polyfill object-fit


Polyfill object-fit/object-position on <img>: IE9, IE10, IE11, Edge, Safari, ...

Documentation

Script

HTML
<img class='your-favorite-image' src='image.jpg'>
						
CSS
.your-favorite-image {
	object-fit: cover;
	object-position: bottom;
	font-family: 'object-fit: cover; object-position: bottom;';
}
JavaScript
objectFitImages();
						

Polyfill for CSS position: sticky


HTML
<div class="sticky"> ... </div>
						
CSS
.sticky {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
}

.sticky:before,
.sticky:after {
	content: '';
	display: table;
}
JavaScript
/* JS */
var elements = document.querySelectorAll('.sticky');
Stickyfill.add(elements);

/* jQuery */
var elements = $('.sticky');
Stickyfill.add(elements);