Betiok
6/15/2017 - 12:54 PM

Sticky Element With Resize

Sticky Element With Resize

/* Sticky Slider */

$(window).on('resize',function () {
    if (!$("#sticky-wrapper").length) {
        if($(window).width() >= 960) {
		$('.main-container .slider').sticky({
			topSpacing: 93,
			bottomSpacing: $('.bottom-location').innerHeight() + $('.footer').innerHeight() - 93
		});

		$('.main-container .slider').sticky('update')
        }
    }

    if($(window).width() <= 980) {
        $('.main-container .slider').unstick();
    }
});

$(window).trigger('resize');