@
@
@eashla2020-06-03 05:17:16
JavaScript
@eashla, 2020-06-03 05:17:16

How to install Lazy Load for html site?

Hello everyone!
I’ll make a reservation right away - I don’t understand the above html and css.
It will probably be about javascript, or rather the syntax.
There is a site (1-page landing) cobbled together on bitrex, but as a result, html files are on the host and in several css and js folders that are called through the index file.

So I want to install jquery.eisbehr.de/lazy Hold on
now!
I DON'T KNOW HOW TO INSTALL IT.....
Here's what I blinded

<script src="http://code.jquery.com/jquery-latest.js"></script> //загружаем JQuery
<script type="text/javascript" src="/jquery.lazy-master/jquery.lazy.min.js"></script> //Lazy файл, работающий на вышезагружанном JQuery
   <script type="text/javascript"> $(function() {
    $('.lazy-load').lazy();
    });</script> //настройка Lazy


The last one I just don't understand how to properly clamp. I.e:
<script type="text/javascript">...</script> или <script>...</script> или <script type="text/javascript" ........</script>.

And in general, it looks kind of creepy.
That's all I put in between Doesn't work. I should have a basic setting like jquery.eisbehr.de/lazy/example_basic-usage I added class="lazy" for images without a class Looks like this:
<head>.....</head>

<img src="/images/flags/flag_ru.png" class="lazy-load" />


I understand that this is not at any gate, but I need your help - I have been suffering all day.
Point out the mistake, please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Glebov, 2020-06-03
@SkiperX

loading="lazy" and polyfill if needed

G
galaxy, 2020-06-03
@galaxy

<img src="/images/flags/flag_ru.png" class="lazy-load" />

So they are loaded normally. It should be like this:
<img data-src="/images/flags/flag_ru.png" class="lazy-load" />

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question