Skip to content

Instantly share code, notes, and snippets.

@WilliamIsted
Last active August 25, 2016 10:17
Show Gist options
  • Save WilliamIsted/b004b0c142747b8a9980f80205ca1bb7 to your computer and use it in GitHub Desktop.
Save WilliamIsted/b004b0c142747b8a9980f80205ca1bb7 to your computer and use it in GitHub Desktop.
Fix for when a slider has broken positioning from being previously hidden
jQuery(function($) {
$(document).on( 'click', '.tab', function() {
$('.slick')
.find('.news-item')
.css({ height: '' }) // Remove the height calculated when hidden
.find('.news-item__title')
.css({ height: '' }); // Remove the height calculated when hidden
$('.slick').slick('getSlick').checkResponsive(); // Trigger same internal functions as `orientationchange` event.
$('.slick').slick('getSlick').setPosition(); // Trigger same internal functions as `orientationchange` event.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment