Skip to content

Instantly share code, notes, and snippets.

@Tusko
Last active October 4, 2018 07:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tusko/278a7dcd5a4ad2867482 to your computer and use it in GitHub Desktop.
Save Tusko/278a7dcd5a4ad2867482 to your computer and use it in GitHub Desktop.
// Custom JS
var catConfig = {
hideControlOnEnd: true,
adaptiveHeight: true,
infiniteLoop: false,
useCSS: false,
prevText: '',
nextText: '',
pager: false,
speed: 350
},
tabsliders = [];
$('#catalog .slides > div').each(function(i, slider) {
tabsliders[i] = $(slider).bxSlider(catConfig);
});
$('#catalog nav a').click(function() {
var sl = $('#catalog .cat-wrap');
if(!$(this).hasClass('cat-active')) {
sl.height(sl.height());
$('#catalog nav a').removeClass('cat-active');
$(this).addClass('cat-active');
$('#catalog .slides').hide().eq($(this).index()).fadeIn(350, function(){
sl.removeAttr('style');
});
$.each(tabsliders, function(i, slider) {
slider.reloadSlider(catConfig);
});
window.location.hash = $(this).attr('href');
}
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment