Skip to content

Instantly share code, notes, and snippets.

@sk187
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sk187/7267736c25cd9fb4a4dc to your computer and use it in GitHub Desktop.
Save sk187/7267736c25cd9fb4a4dc to your computer and use it in GitHub Desktop.
Display None Transition Hack
////////////////////
//JavaScript Logic//
////////////////////
$('.project_btn').each(function(index) {
$(this).on('click', function(){
$(this).addClass('selected')
$('.project_btn').not(this).removeClass('selected')
var tab = ($('.project.info').eq(index))
var otherTabs = ($('.project.info').not(tab))
console.log(index)
if (otherTabs.hasClass('active')){
otherTabs.removeClass('active');
otherTabs.addClass('vis_hidden');
setTimeout(function(){
otherTabs.addClass('hidden');
},20)
}
if (tab.hasClass('hidden')){
tab.removeClass('hidden');
setTimeout(function(){
tab.removeClass('vis_hidden')
tab.addClass('active')
}, 50)
}
//Closes active tab
else{
// tab.addClass('vis_hidden');
// tab.removeClass('active');
// tab.one('transitionend',function(event){
// tab.addClass('hidden');
// });
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment