Tell me if it is possible to disable the slick carousel on any permissions? For example, if you initialize it on desktops so that the carousel works and on mobile so that it turns off.
- Check the screen resolution and if appropriate - then initialize the plug-in) What did you fail? Find out the screen resolution? - Moonvvell
- @Moonvvell I did not look at solving the problem in this way, I thought that maybe there is some method that disables the plugin on a specific breakpointe. - Constantine Shibaev
|
1 answer
In the responsive property, you specify an array of objects with breakpoints. On one of the breakpoints you need, you must pass the settings property instead of an object to pass the value of unslick .
From the official documentation (scroll to the block Responsive Display ):
responsive: [ { breakpoint: 1024, settings: { slidesToShow: 3, slidesToScroll: 3, infinite: true, dots: true } }, { breakpoint: 600, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } // You can unslick at a given breakpoint now by adding: // settings: "unslick" // instead of a settings object ] - Tried to do so did not work so I decided to ask a question. Apparently, I did not understand correctly how the breakpoint works, I thought it was set to min-width, but it turns out to be max-width, in any case, I thank you for the clarification. PS Now you do not need to use the device to calculate the width of the device)) - Constantine Shibaev
|