Skip to content

Object-fit alternative only for IE. It helps to fit the image into the containers.

License

Notifications You must be signed in to change notification settings

Phe0nix/object-fit-ie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

object-fit-ie

object-fit polyfill only for images in IE. Every other browsers (Chrome, Safari, Firefox, Opera, Edge) supported 'object-fit' property. It help to fit the image into the containers.

Demo - Demo Link

This is only built for IE due to no support of object-fit css property.

It support from version 9. Below 9, still in progress.

Syntax

objectFitIE.ieImg('image-wrapper-class-name', 'object-position x', 'object-position y', 'object-fit');
  1. image-wrapper-class-name - place your wrapper class name here. see the example below -
<div class='wrapper-name'>
  <img src='' alt=''>
 </div>

It will target the class wrapper-name. Make sure, within the wrapper only one image will be there.

  1. object-position x and object-position y - place the values for x and y axis. just like the object-position in css.
  2. object-fit - place the object-fit value just like you put it in css.

Usage

  1. create the wrapper of the image where you want to apply object-fit property.
  2. include the object-fit-ie.js file in your codebase.
  3. call this before </body> -
objectFitIE.ieImg('image-wrapper-class-name', 'object-position x', 'object-position y', 'object-fit');
  1. and see it in IE browser.

About

Object-fit alternative only for IE. It helps to fit the image into the containers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages