D
D
danilr2020-01-29 09:07:21
JavaScript
danilr, 2020-01-29 09:07:21

How can I make the slick slider only apply to mobile devices (resolution less than 759px)?

I want to use this slider kenwheeler.github.io/slick
I use Vue and I need to understand where to initialize the slider, where to turn it off or on the contrary to turn it on so that it works only on a mobile phone. Tell me how to use the slider exactly there. There is an unslick method, but I don't understand how to use it in the Vue framework

Answer the question

In order to leave comments, you need to log in

1 answer(s)
�
Сергей delphinpro, 2020-01-29
@danilr

Why mix two ecosystems?
Look for a slider on vue. Or at least vanilla.
On the question:
in mounted, hang the matchMedia listener on the desired range and initialize / deactivate the slick in it.
in addition, you can use the built-in functionality. Pay attention to this example - in the range 0..300 the slider is turned off.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question