V
V
Vadim Kinev2021-03-31 17:27:42
JavaScript
Vadim Kinev, 2021-03-31 17:27:42

How to initialize slick slider on screen rotation?

Good afternoon everyone! I ran into a problem
. There is a slider that has the property mobileFirst: true, 1050px + it initializes the slider, but if we take for example an iPad Pro with a resolution of 1024x1366, with a width of 1366 it does not initialize slick, but if it is turned over, everything also does not initialize and an overlay appears.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2021-03-31
@cupok

Maybe something like this would work

// Прослушка события смены ориентации
window.addEventListener("orientationchange", function() {
    // Выводим числовое значение ориентации
    alert(window.orientation);
}, false);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question