Owl carousel and picture tag?

  • 0
    Does owl carousel work with the picture tag? I need to display different images in the carousel at different resolutions, but for some reason the source tags are simply ignored.
    <picture>
            <source srcset="<?=  $some_image['url']; ?>" alt="<?=   $some_image['alt']; ?>" media="(max-width: 1200px)">
            <source srcset="<?=  $other_image['url']; ?>" alt="<?=   $other_image['alt']; ?>" media="(max-width: 768px)">
             <img src="<?=  $some_image['url']; ?>" alt="<?=   $some_image['alt']; ?>" />
    </picture>
    JavaScript Anonymous, Aug 13, 2020

  • 2 Answers
  • 0
    Owl carousel works with any tags as slides.

    for some reason the source tags are simply ignored


    They will be ignored even without the carousel.

    Because the media are not specified correctly and they also do not have an alt.
    Anonymous

  • 0
    Apparently you have something wrong.

    https://codepen.io/mromanoff/pen/zxrgLv
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!