|
1 |
| -$(window).on("scroll", function () { |
2 |
| - if ($(this).scrollTop() > 200) { |
3 |
| - $(".navbar").addClass("transparent"); |
4 |
| - // $(".navbar").stop().animate({opacity: 0}); |
5 |
| - } |
6 |
| - else { |
7 |
| - $(".navbar").removeClass("transparent"); |
8 |
| - // $(".navbar").stop().animate({opacity: 1}); |
9 |
| - } |
10 |
| -}); |
11 |
| -$(window).on("scroll", function () { |
12 |
| - if ($(this).scrollTop() > 0) { |
13 |
| - $(".navbar").addClass("navbar-scroll"); |
14 |
| - // $(".navbar").stop().animate({opacity: 0}); |
15 |
| - } |
16 |
| - else { |
17 |
| - $(".navbar").removeClass("navbar-scroll"); |
18 |
| - // $(".navbar").stop().animate({opacity: 1}); |
19 |
| - } |
| 1 | +$(document).ready(function() { |
| 2 | + $(window).bind('resize', function() { |
| 3 | + if (window.location.pathname == '/' || window.location.pathname == '/index.html') { |
| 4 | + if (window.outerWidth < 768) { |
| 5 | + $('.navbar').removeClass('jupytercon-navbar'); |
| 6 | + $('.tab').addClass('black-tab'); |
| 7 | + document.getElementById('jupyter-nav-logo').src = '/assets/nav_logo.svg'; |
| 8 | + $('.icon-bar').removeClass('white-icon-bar'); |
| 9 | + } |
| 10 | + else { |
| 11 | + console.log(window.location.pathname); |
| 12 | + $('.navbar').addClass('jupytercon-navbar'); |
| 13 | + $('.tab').removeClass('black-tab'); |
| 14 | + document.getElementById('jupyter-nav-logo').src = '/assets/white_nav_logo.svg'; |
| 15 | + $('.icon-bar').addClass('white-icon-bar'); |
| 16 | + } |
| 17 | + } |
| 18 | + }); |
| 19 | + $(window).on("scroll", function () { |
| 20 | + if ($(this).scrollTop() > 0) { |
| 21 | + $(".navbar").addClass("navbar-scroll"); |
| 22 | + // $(".navbar").stop().animate({opacity: 0}); |
| 23 | + |
| 24 | + // For JupyterCon Custom Navbar |
| 25 | + if (window.location.pathname == '/' || window.location.pathname == '/index.html') { |
| 26 | + $('.navbar').removeClass('jupytercon-navbar'); |
| 27 | + $('.tab').addClass('black-tab'); |
| 28 | + document.getElementById('jupyter-nav-logo').src = '/assets/nav_logo.svg'; |
| 29 | + $('.icon-bar').removeClass('white-icon-bar'); |
| 30 | + } |
| 31 | + } |
| 32 | + else { |
| 33 | + $(".navbar").removeClass("navbar-scroll"); |
| 34 | + // $(".navbar").stop().animate({opacity: 1}); |
| 35 | + |
| 36 | + // For JupyterCon Custom Navbar |
| 37 | + if (window.location.pathname == '/' || window.location.pathname == '/index.html') { |
| 38 | + if (window.outerWidth < 768) { |
| 39 | + $('.navbar').removeClass('jupytercon-navbar'); |
| 40 | + } |
| 41 | + else { |
| 42 | + console.log(window.location.pathname); |
| 43 | + $('.navbar').addClass('jupytercon-navbar'); |
| 44 | + $('.tab').removeClass('black-tab'); |
| 45 | + document.getElementById('jupyter-nav-logo').src = '/assets/white_nav_logo.svg'; |
| 46 | + $('.icon-bar').addClass('white-icon-bar'); |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + }); |
20 | 51 | });
|
0 commit comments