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

exo 2 add default page

parent e5d1f900
No related branches found
No related tags found
No related merge requests found
import $ from 'jquery' import $ from 'jquery'
const defaultPage = 'slideshow';
$(() => { $(() => {
showSection(defaultPage);
$('nav > ul > li > a').click(element => { $('nav > ul > li > a').click(element => showSection(element.delegateTarget.id));
const id = element.delegateTarget.id;
function showSection(sectionName) {
$('nav > ul > li > a').removeClass('selected'); $('nav > ul > li > a').removeClass('selected');
$('nav > ul > li > a#' + id).addClass('selected'); $('nav > ul > li > a#' + sectionName).addClass('selected');
showSection(id);
});
function showSection(sectionName) {
$('body > section').hide(); $('body > section').hide();
$('body > section.' + sectionName + 'Container').show(); $('body > section.' + sectionName + 'Container').show();
console.log(sectionName);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment