/*============================================ Navigation ==============================================*/ $('.nav-toggle').on('touchstart click', function(e) { e.preventDefault(); $( this ).toggleClass( 'active' ); }); $(function dw_hidenav() { var headerHeight = $('.navbar').height(); $(window).on('scroll', { previousTop: 0 }, function() { var currentTop = $(window).scrollTop(); if (currentTop < this.previousTop) { if (currentTop > 0 && $('.navbar').hasClass('fixed')) { $('.navbar').addClass('visible'); } else { $('.navbar').removeClass('visible fixed'); } } else { $('.navbar').removeClass('visible'); if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed'); } this.previousTop = currentTop; } ); }); /* ----------------------------- (function( $ ) { $.fn.timespent = function(options){ var urla = "https://davidawindham.com/wik/index.php?module=API&method=UserCountry.getCity&format=json&idSite=1&period=month&date=yesterday&expanded=1&token_auth=d97e3e8f34071515ad1f6e345f6035af"; var data = []; function isLoaded (recentElement) { for (var i = 0; i < country.length; i++){ var markup = $("