SRCSET attribute on images

hanahavandi's Avatar

hanahavandi

02 Jul, 2016 12:55 AM

Is there any way you could provide an API that allows us to use the new SRCSET attribute on Images
Thanks

  1. Support Staff 1 Posted by Dmitry Semenov on 02 Jul, 2016 05:13 AM

    Dmitry Semenov's Avatar

    Hello,

    You can already use it, just define it for IMG element in a slide. Do you get some specific issue with it?

    Dmitry

  2. 2 Posted by hanahavandi on 03 Jul, 2016 12:21 AM

    hanahavandi's Avatar

    Hi,
    Dont understand. If you are lazy loading, the markup is:

    <a class="rsImg" href="path-to-image.jpg">image description</a> and then via javascript you are setting the src attribute , but we need to set the srcset attribute of images.

    Am I correct or have I got it all wrong?
    Thanks

  3. Support Staff 3 Posted by Dmitry Semenov on 03 Jul, 2016 02:30 PM

    Dmitry Semenov's Avatar

    For lazy-loading markup it's not supported as slider needs to know the exact dimensions of the current image as well as selected src. But if you wish to serve responsive images, you may just modify the href attribute of <a class="rsImg"> via JS before slider initialization based on current screen size or resolution.

    Dmitry

  4. 4 Posted by hanahavandi on 04 Jul, 2016 01:37 AM

    hanahavandi's Avatar

    This would defeat the whole objective of the SRCSET attribute and you may as well just resort to current js solutions? May be a future version? Considering the web today and the new browsers support for srcset, this should be an important upgrade to the plugin as Lazy loading is definitely a must.
    Thanks.

  5. hanahavandi closed this discussion on 29 Jun, 2017 08:21 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac