Skip to content
Snippets Groups Projects
Select Git revision
  • e5d1f9001561bf866bdfa7f25d9a21d0953d56f3
  • master default protected
2 results

main.js

Blame
  • main.js 466 B
    import $ from 'jquery'
    
    $(() => {
    
    
        $('nav > ul > li > a').click(element => {
    
            const id = element.delegateTarget.id;
    
            $('nav > ul > li > a').removeClass('selected');
            $('nav > ul > li > a#' + id).addClass('selected');
            showSection(id);
        });
    
    
        function showSection(sectionName) {
            $('body > section').hide();
            $('body > section.' + sectionName + 'Container').show();
            console.log(sectionName);
        }
    
    
    });