Only use slick.js on mobile screen size
btw now you can do this directly in the slick responsive settings object
mobileFirst: true,
responsive: [
{
breakpoint: 480,
settings: "unslick"
}
]
The problem is unslick keeps firing on resize even after it has been unslicked, which in turn, breaks it. A work around that my coworker came up with goes like this check..
var target = $('.slick-mobile-gallery');
if(target.hasClass('slick-initialized'))
target.unslick();
Update:
The solution is built-in feature in slick
plugin & @James Daly's answer is the true answer to this question.