luis-almeida / unveil

A very lightweight jQuery plugin to lazy load images
4.15k stars 675 forks source link

Retina smart resize #111

Open jack-fdrv opened 8 years ago

jack-fdrv commented 8 years ago

Plz include this small smlall code to ur code =) Or rewrite with ur point of view =)

if(retina && this.getAttribute('data-src-retina') && !this.getAttribute('data-retina-no-resize')) {
    this.onload = function() {
        this.style.width = (this.width / 2)+ 'px';
    }
}
peteriliev- commented 6 years ago

Where should this be added in order to work and not show retina images four times larger? Thanks.