Last active
February 13, 2019 15:08
-
-
Save MyCueCards/d03a25245c8284f858b093e40d692eaa to your computer and use it in GitHub Desktop.
In Bootstrap, this looks for a string in the URL and actives the tabs for either English or Spanish without having to open a different window.
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
$(document).ready(function () { | |
if (window.location.href.indexOf("?lang=en") > -1) { | |
function doEnglish() { | |
$('#english').addClass('active'); | |
$('#en').addClass('active'); | |
$('#español').removeClass('active'); | |
$('#es').removeClass('active'); | |
} | |
setTimeout(doEnglish, 0); | |
} else { | |
function doSpanish() { | |
$('#español').addClass('active'); | |
$('#es').addClass('active'); | |
$('#english').removeClass('active'); | |
$('#en').removeClass('active'); | |
} | |
setTimeout(doSpanish, 0); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment