Last active
December 15, 2015 08:29
-
-
Save hayatbiralem/5231146 to your computer and use it in GitHub Desktop.
Just a simple solution for refresh CarouFredSel dimensions after tabs changed...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".tab_content").hide(); | |
$(".tab_content:first").show(); | |
$("ul.tablar li").click(function () { | |
$("ul.tablar li").removeClass("active"); | |
$(this).addClass("active"); | |
$(".tab_content").hide(); | |
var index = $("ul.tablar li").index(this); | |
// $('.tab_content').eq(index).fadeIn(500); | |
$('.tab_content').eq(index).css({opacity:"0", display: "block"}); // show tab and set opacity 0 | |
$('#slayt'+(index+1)).trigger('updateSizes'); // refresh dimensions | |
$('.tab_content').eq(index).css({opacity:"1", display: "none"}).fadeIn(500); // fade animation after hide tab and set opacity 1 | |
}); | |
$('#slayt1').carouFredSel({ | |
auto: {timeoutDuration : 5000, pauseOnHover: 'resume'}, | |
prev: '#prev1', | |
next: '#next1' | |
}); | |
$('#slayt2').carouFredSel({ | |
auto: {timeoutDuration : 5000, pauseOnHover: 'resume'}, | |
prev: '#prev2', | |
next: '#next2' | |
}); | |
$('#slayt3').carouFredSel({ | |
auto: {timeoutDuration : 5000, pauseOnHover: 'resume'}, | |
prev: '#prev3', | |
next: '#next3' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this. I have found a way to update the carousel size. 😄
$('#faces').trigger('updateSizes')