question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slick is never reenabled after "unslicked" at breakpoint

See original GitHub issue

I use settings: 'unslick' to disable Slick at certain breakpoints. But as soon as Slick is disabled (either by resizing or at page load), it will never be reenabled when resizing. Example:

$('.my-class').slick({
    mobileFirst: true,
    slidesToShow: 2,
    slidesToScroll: 2,
    responsive: [ {
        breakpoint: 768,
        settings: 'unslick'
    } ]
});

Loading the page with a viewport narrower than 768px enables Slick, resizing beyond 768px disables Slick, but resizing back below 768px keeps Slick disabled.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:21 (1 by maintainers)

github_iconTop GitHub Comments

44reactions
vfoniccommented, Apr 11, 2017

+1

The way I solved both issues is with these couple of extra lines of code:

$(window).resize(function() {
  $('.js-slider').slick('resize');
});

$(window).on('orientationchange', function() {
  $('.js-slider').slick('resize');
});

EDIT: The above could probably be shortened to:

$(window).on('resize orientationchange', function() {
  $('.js-slider').slick('resize');
});
20reactions
stratboycommented, Dec 27, 2016

+1.

And docs should mention this issue and should not feature unslick on the responsive part, since it simply doesn’t work as expected, as really a lot of threads and developers are reporting. So much threads definitely make this one an issue and a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Responsive breakpoints not working for slick slider
@ntgCleaner Slider doesn't break after I resize the browser. It works fine but that settings doesn't work. If I reload the page at...
Read more >
Settings not available in breakpoint always use system default
The problem is in slick.load.js that creates the defaults for each breakpoint using a combination of drupalSettings.slick, globals(o) and the ...
Read more >
Welcome to SlickEdit 2020 - ComponentSource CDN
SlickEdit, Visual SlickEdit, Clipboard Inheritance, DIFFzilla, SmartPaste, Context Tagging, Slick-C, and Code Quick | Think Slick are.
Read more >
SlickEdit User Guide
Produced in the United States of America. SlickEdit, Visual SlickEdit, Clipboard Inheritance, DIFFzilla, SmartPaste, Context Tagging, and Slick-C are registered ...
Read more >
Untitled
Tag flour challenge, You're almost welcome meaning, Abilene texas county jail, ... Manu keirse later begint vandaag, Maria carla modella italiana, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found