Comments (4)
Thanks for providing a JSFiddle! You're missing a ;
after the font-family
line. Notice how position
has the wrong color.
from object-fit-images.
I copied it from the example on the readme! LOL :) I fixed that, but it's still using the src rather than the srcset in IE 11.
Thank you for the quick reply.
from object-fit-images.
Any thoughts on what I might be doing wrong? I've tried everything I can think of and even looked through the source, but I can't figure it out. I appreciate your time.
It should be showing a green image (srcset), but in IE 11 it shows the red image from src. https://jsfiddle.net/4bvd2wum/3/
from object-fit-images.
Ok. I'm a moron. Object-fit-images is doing its job just fine - fitting the image to its container.
My issue is that IE does not support srcset. Browsers that do support srcset, set a currentSrc
property on the image after deciding which image to use. Object-fit-images uses the currentSrc property (falling back to src) to determine the image to use.
So, if you're using srcset you need an additional polyfill - Picturefill. If I had read the documentation thoroughly I would have caught this. Object-fit-images works with Picturefill to use the desired image from srcset.
@bfred-it Feel free to correct anything I've said that's incorrect. Thank you again for your help and for your work on this script!
from object-fit-images.
Related Issues (20)
- Assignment to read-only properties is not allowed in strict mode HOT 2
- Load event handler should get called when backgroundImage style is rendered. HOT 1
- Changing the src results in a "data-ofi-undefined" attribute. HOT 1
- Media Query images using `<source>` tag not working HOT 2
- Assignment to read-only properties is not allowed in strict mode HOT 13
- Fix documentation on es6 import HOT 7
- How to use this in angular project? HOT 2
- Error during tests HOT 2
- Test in IE with version 3.2.4 HOT 1
- IE11: Including the polyfill in two different libraries via ES6 imports then including both onto the page breaks it HOT 2
- > Assignment to read-only properties is not allowed in strict mode
- Doesn't support Edge 15 HOT 1
- react how to use ,ie11 is not working? HOT 1
- cloudinary videos is not working in IE 11 i.e object fit HOT 1
- Unable to use with Next HOT 2
- A request to have a de-initialization (cleanup) API HOT 2
- IE renders the svg object in background-image property HOT 10
- Uncaught (in promise) TypeError: _objectFitImages2.default.objectFitImages is not a function HOT 1
- <picture> element in Edge HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from object-fit-images.