Last active
August 29, 2015 14:21
-
-
Save sk187/7267736c25cd9fb4a4dc to your computer and use it in GitHub Desktop.
Display None Transition Hack
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
//////////////////// | |
//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