Need help getting srcset to work with Owl Carousel

I’m trying to get srcset to work with my carousel. It works perfect when the links are going to https://placehold.it. When I change the links to my images, the image does not load. Any ideas? https://www.mrpitbull.com/index-copy.html.
This works:

<img src="https://placehold.it/320x300/35478C/FFF8E3&text=Fallback+image"
               sizes="100vw"
               srcset=" https://placehold.it/768x720/33332D/FFF8E3&text=768w+720h 768w,
                       https://placehold.it/1280x500/33332D/FFF8E3&text=1280w+500h 1280w,
                       https://placehold.it/2520x700/33332D/FFF8E3&text=2520w+700h 2520w" 
               alt="image" />

This doesn’t work:

<img src="images/razors-edge-pit-banner1920.jpg"
               sizes="100vw"
               srcset="images/razors-edge-pit-banner480 480w,
                       images/razors-edge-pit-banner640 640w,
                       images/razors-edge-pit-banner940 940w,
                       images/razors-edge-pit-banner1366 1366w,
                       images/razors-edge-pit-banner1920 1920w"
               alt="razor's edge pitbull" />

Shouldn’t your srcset images have a .jpg extension?

images/razors-edge-pit-banner480.jpg 480w

etc.

2 Likes

Don’t I feel dumb! I was baffled. Funny, how many times I looked at that and missed it. Works like a champ now. Thanks again.

1 Like

Glad I could help. smile

No need to feel bad. I’m sure we’ve all made the same kind of mistake at one time or another (I know I have), where all it takes is another pair of eyes. privateeyes

1 Like

Any idea how I can get lazyload to work?

<off topic>

The three back-tics in several places in the code in your first post should be on a line by themselves to preserve the formatting of the code. :slight_smile:

Sounds like a new topic. :slight_smile:

Cheers

Thanks for the help.