Questions tagged [picturefill]

The picture element and associated features are W3C standard HTML features that allow web developers to deliver an appropriate image to every user depending on a variety of conditions like screen size, viewport size, screen resolution, and more. Picturefill is a JavaScript file (or a polyfill to be more specific) that enables support for the picture element and associated features in browsers that do not yet support them, so you can start using them today!

79 questions
17
votes
1 answer

When using picture, source and srcset how check which src was loaded? (img.src is empty)

I'm using the picture element with source's to choose which image to load. And while I can add a load listener, I cannot figure out which image was loaded as the img tag's src attribute and property are both empty, even when loaded!
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
15
votes
6 answers

HTML5 Picture element does not seem to be supported by Chrome 52? Srcset not working

I just started a new webpage so there's not much markup to go over. I set this down:
Aslan French
  • 520
  • 2
  • 6
  • 23
15
votes
2 answers

Detect "image corrupt or truncated" in Firefox

(Pre-emptive strike: If you're tempted to mark this as a duplicate, note that other questions seem to ask "why am I getting this error?" I know why I'm getting this error; I want to know how I can detect the error in my JavaScript code. It only…
Trott
  • 66,479
  • 23
  • 173
  • 212
12
votes
2 answers

img srcset - disregard pixel density

I have two images, one is 1000 x 800 px ("large"), and one is 200 x 200 px ("small"). I want to use srcset / sizes / picturefill to display the small image when the screen is less than or equal to 500 CSS pixels wide, and the large image…
mark
  • 4,678
  • 7
  • 36
  • 46
11
votes
2 answers

Get image source by ID with size

I'm working on a WP site with some promotion / advert sliders with a Google Analytics click event. Works great, now I want to serve the right image on the right resolution. I'm using picturefill for serving the images. Works fine while hardcoded, so…
Kortschot
  • 981
  • 1
  • 7
  • 21
8
votes
1 answer

picture element does not work in angular2 and firefox

I have a "logo" component which essentially writes out a picture element. The template look like this:
8
votes
1 answer

Responsive images: img srcset + Bootstrap, wrong size image gets loaded

I'm using Bootstrap with Responsive Images. I want to optimize load times by offering multiple image sizes to browsers. According to this article, a plain approach with srcset like this is good for letting the browser pick the optimal image…
Andrew
  • 817
  • 2
  • 10
  • 21
5
votes
2 answers

element is not working as expected in Safari browser, while using React

I am facing an issue with "picture" element in React, particularly with safari browser. Safari is always fetching image from "img" element src along with the image from appropriate "source" element based on media attribute. This seem to work fine in…
5
votes
1 answer

Select rendered picture element image in chrome

I have a need to re-use the rendered image of a picture element. Is there a direct way to use javascript to access the image file path rendered by chrome/opera without having to replicate the logic that picturefill completes.
Jason
  • 210
  • 1
  • 8
4
votes
1 answer
4
votes
2 answers

Recommended way of using React + Picturefill

I want to use Picturefill + React + React Router (Also using Webpack). Context: There is no isomorphic architecture yet so the data is fetched after initial page load (Route change). …Because of this the render method is being called twice. Once…
chemoish
  • 1,210
  • 2
  • 13
  • 23
4
votes
2 answers

UPDATE: Responsive images in AngularJS

Original Issue for Posterity (see updates) I've got an Angular.js website I'm building out to be responsive. I wanted to use separate resolution images for different browser widths as well. So, I stumbled upon Picturefill.js, which seems like it…
3
votes
1 answer

Picturefill and lazyloading with lazysizes

I'm trying to get lazyloading with lazysizes and picturefill to work. The lazyloading itself works if I just use a basic image: If I check the network tab in chrome, I can see that the…
NthDegree
  • 1,301
  • 2
  • 15
  • 29
3
votes
2 answers

ng-srcset images initially not displaying in IE11 intermittently

The page loads without any of the images displaying on IE11 only, but refreshes them accordingly when we resize the browser intermittently (1/3 loads). We cannot replicate this with any of the other browsers. srcset works fine by itself with static…
Matt Rowles
  • 7,721
  • 18
  • 55
  • 88
3
votes
3 answers

Is it valid to use both src and srcset on an image-tag with picturefill?

I have been using the following markup for a while: Lorem Ipsum This works quite perfectly with picturefill (http://scottjehl.github.io/picturefill/) and doesn't give…
Sylvareth
  • 135
  • 2
  • 8
1
2 3 4 5 6