Skip to content
Snippets Groups Projects
Commit e5d1f900 authored by Aymeric Henouille's avatar Aymeric Henouille
Browse files

exo 2 display good section

parent 790af61e
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,20 @@ $(() => { ...@@ -4,9 +4,20 @@ $(() => {
$('nav > ul > li > a').click(element => { $('nav > ul > li > a').click(element => {
const id = element.delegateTarget.id;
$('nav > ul > li > a').removeClass('selected'); $('nav > ul > li > a').removeClass('selected');
$('nav > ul > li > a#' + element.delegateTarget.id).addClass('selected'); $('nav > ul > li > a#' + id).addClass('selected');
showSection(id);
}); });
function showSection(sectionName) {
$('body > section').hide();
$('body > section.' + sectionName + 'Container').show();
console.log(sectionName);
}
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment