git ssb

0+

k4ml / belajar-js



Tree: dd63fd2e084657c42584b0c568c51cae9c306aa7

Files: dd63fd2e084657c42584b0c568c51cae9c306aa7 / javascripts / nav.js

646 bytesRaw
1(function() {
2 var nav_els, current_view, viewport_view;
3 nav_elm = document.getElementsByClassName('nav nav-tabs')[0];
4 viewport_view = document.getElementById('viewport-view');
5 if (!current_view) {
6 viewport_view.innerHTML = document.getElementById('viewport-home').innerHTML;
7 }
8 nav_elm.addEventListener('click', function (e) {
9 var hash, viewport;
10 if (e.target.hash) {
11 hash = e.target.hash.split('#')[1];
12 viewport = document.getElementById('viewport-' + hash);
13 viewport_view.innerHTML = viewport.innerHTML;
14 current_view = hash;
15 }
16 });
17}());
18

Built with git-ssb-web