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