C
C
cyberlain2017-02-06 06:58:32
JavaScript
cyberlain, 2017-02-06 06:58:32

Slick slider how to load images with ajax?

There is a slick slider with 12 slides and each one has a megabyte picture. I told the customer that the pictures should be optimized, but he insisted on 80% jpg quality. As a result, the site slows down because of these huge pictures. Question - how to load images in a slick slider with ajax, and not with direct requests when loading a site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Zhubartovich, 2017-02-06
@cyberlain

From the documentation page

$('.lazy').slick({
  lazyLoad: 'ondemand',
});

I also advise you to run images through tinypng

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question