Toggle Between Two Slick Sliders on Click

A type of layout you might use to compare service types offered by your client may require you to toggle back and forth via a button.

example toggle slick slider, first toggle

example toggle slick slider, second toggle

jQuery(".member_col.blue h1").click(function(){
	jQuery("#members_block").removeClass('yellow');
	jQuery("#members_block").addClass('blue');
	
	jQuery('.members_slide.yellow').css('display', 'none'); 
	jQuery('.members_slide.blue').css('display', 'block'); 
	jQuery('.members_slide.blue').get(0).slick.setPosition();
});

jQuery(".member_col.yellow h1").click(function(){
	jQuery("#members_block").removeClass('blue');
	jQuery("#members_block").addClass('yellow');
	
	jQuery('.members_slide.blue').css('display', 'none'); 
	jQuery('.members_slide.yellow').css('display', 'block'); 
	jQuery('.members_slide.yellow').get(0).slick.setPosition();
});

Sourced here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.