K
K
Kirill Petr2018-08-28 19:14:49
css
Kirill Petr, 2018-08-28 19:14:49

Using Media in JavaScript?

Not strong in JS, you need to write media queries for this function in JS so that "step: 3" changes at a certain screen size to "step: 2" or "step: 1".

jQuery(function($){
    $('ul#items').easyPaginate({
        step:3
    });
});

Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MrStan1slav, 2018-08-28
@MrStan1slav

This is done using matchMedia in js.
Documentation = {
Russian: https://developer.mozilla.org/en/docs/Web/API/Wind... ,
English: https://www.w3schools.com/jsref/met_win_matchmedia.asp
}
Material: https: //loftblog.ru/material/izuchaem-matchmedia-a...
If you are a fan of jQuery and cannot live without it: https://habr.com/post/318972/

D
Dmitry Belyaev, 2018-08-28
@bingo347

https://developer.mozilla.org/ru/docs/Web/API/Wind...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question