Created
April 10, 2019 10:46
-
-
Save alt-karate/19f3d5a60967e25c4c3696c839b81888 to your computer and use it in GitHub Desktop.
test.js
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
$(function() { | |
if ($('#menu')[0]) { | |
var $tabcontAry = [$('#menuA'), $('#menuB'), $('#menuC')]; | |
$('.menu__tab a').off().on('click', function() { | |
if (!$(this).hasClass('active')) { | |
$('.menu__tab a').removeClass('active'); | |
$(this).addClass('active'); | |
var clickdNum = $('.menu__tab a').index($(this)); | |
for (var i = 0; i < $tabcontAry.length; i++) { | |
$tabcontAry[i].hide(); | |
} | |
$tabcontAry[clickdNum].fadeIn(200); | |
} | |
return false; | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment