top: 125 + $('#smu2023_event_tabs').height() + "px", 'padding-top': '0', 'z-index': '9999999999999' }); } else { $('#smu2023-menu').css({ position: 'relative', left: '-' + smu2023MenuLeft + 'px', top: 0, 'z-index': '99999' }); if (hasTabs) $('#smu2023_event_tabs').css({ position: 'relative', left: '-' + smu2023EventTabsLeft + 'px', top: 0 + 'px', 'padding-top': '1%', 'z-index': '9999999999999' }); } } else if (isMobile3) { if (mobileStickyMenu) { $('#startmeuphk-festival-2023-programme .scroll-watch-placeholder,#startmeuphk-festival-2023-partners .scroll-watch-placeholder,#startmeuphk-festival-2023 .scroll-watch-placeholder').hide(); $('#smu2023-menu').css({ position: 'fixed', left: 0, top: 0, 'z-index': '9999999999999', }); if (hasTabs) $('#smu2023_event_tabs').css({ position: 'fixed', left: 0, top: $('#smu2023_event_tabs').height() - 5 + "px", // top: 125+$('#smu2023_event_tabs').height()+"px" , 'z-index': '9999999999999', 'padding-top': '0', }); } else { $('#masthead').css({ width: '100%' }); $('#smu2023-menu').css({ position: 'relative', left: '-' + smu2023MenuLeft + 'px', top: 0, 'z-index': '9999999999999' }); if (hasTabs) $('#smu2023_event_tabs').css({ 'padding-top': '1%', position: 'relative', left: '-' + smu2023EventTabsLeft + 'px', top: 0 + 'px', 'z-index': '9999999999999' }); } } else { if ($('#smu2023-menu').length > 0) { if (stickyMenu) { $('#smu2023-menu').css({ position: 'fixed', left: 0, top: $('#masthead').outerHeight() - 3 + 'px', 'z-index': '9999999999999' }); if (hasTabs) $('#smu2023_event_tabs').css({ position: 'fixed', left: 0, 'padding-top': '0', top: $('#masthead').outerHeight() + $('#smu2023_event_tabs').outerHeight() - 20 + "px", 'z-index': '9999999999999' }); } } else { $('#smu2023-menu').css({ position: 'relative', left: '-' + smu2023MenuLeft + 'px', top: 0, 'z-index': '9999999999999' }); if (hasTabs) { $('#smu2023_event_tabs').css({ position: 'relative', left: '-' + smu2023EventTabsLeft + 'px', 'padding-top': '1%', top: 0, 'z-index': '9999999999999' }); } } } }); }); jQuery(document).ready(function ($) { setTimeout(function () { if (location.hash) { window.scrollTo(0, 0); target = location.hash.split('#'); smoothScrollTo($('#' + target[1]), target[2]); } }, 1); if (window.location.hash) { var hash = window.location.hash.substring(-1); // var href_tab_params = hash.split('#')[2]; var href_tab_params = $('a[href=' + hash + ']').attr('data-w-tab') $('.program_tab_link').removeClass('w--current') // $('a.program_tab_link[href=' + hash + ']').addClass('w--current') $('.event_container,.program_container').css('display', 'none') var mainEventLeft = $('#smu2023_main_events').css('left'); if (href_tab_params == 'community-events') { $('#smu2023_community_events').show(); $('#smu2023_community_events').css({ left: mainEventLeft }); } else if (href_tab_params == 'satellite-events') { $('#smu2023_satellite_events').show(); $('#smu2023_satellite_events').css({ left: mainEventLeft }); } else { $('#smu2023_main_events').show(); } $('#nav_menu-1 ul li a').each(function (i, obj) { var href_tab = $(this).attr('href'); href_tab = href_tab.split('#')[0] $(this).attr('href', href_tab + '' + hash); }); } function smoothScrollTo(target, tab = '') { if (tab) { $('.program_tab_link').removeClass('w--current') $('a[data-w-tab=' + tab + ']').addClass('w--current') $('.event_container,.program_container').css('display', 'none') tab_change = tab.replace("-", "_"); const mainEventLeft = $('#smu2024_main_events').css('left'); $('#smu2024_' + tab_change).css({ left: mainEventLeft, 'display': 'block' }); } target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - 370 }, 1000); } } $('.smu-main-event-week-hover,.smu-satellite-event-week-hover,.smu-community-event-week-hover').each(function (i, obj) { var href = $(this).find('a').attr('href'); if (href != '') { $(this).attr('data-href', href); } }); $(document).on('click', '.smu-main-event-week-hover,.smu-satellite-event-week-hover,.smu-community-event-week-hover', function () { var new_href = $(this).attr('data-href'); if (new_href != undefined) { location.href = new_href } }) $('.link_start').each(function (i, obj) { var href = $(this).attr('href'); if (href != '') { $(this).parents('.section-2-row-jum-starter').attr('data-href', href); } }); $(document).on('click', '.section-2-row-jum-starter', function () { var new_href = $(this).attr('data-href'); if (new_href != undefined) { location.href = new_href } }) $(".speaker_block_out").on({ mouseenter: function () { $(".speaker_block_out").addClass('in_active'); $(this).removeClass('in_active'); }, mouseleave: function () { $(".speaker_block_out").removeClass('in_active'); } }); $('form').attr('autoComplete','off') $('input[type="password"]').attr('autoComplete','off') }); //https://stackoverflow.com/questions/23006516/jquery-animated-number-counter-from-zero-to-value jQuery(function($) { function load_js_move_number(){ $('.counter_down div').each(function() { var $this = $(this), countTo = $this.attr('data-count'); $({ countNum: $this.text()}).animate({ countNum: countTo }, { duration: 1000, easing:'linear', step: function() { $this.text(Math.floor(this.countNum)); }, complete: function() { $this.text(this.countNum); } }); }); } if($('#section_move_number').html()!=undefined){ if($(window).scrollTop() + $(window).height()>$('#section_move_number').offset().top){ load_js_move_number() } var winHeight = $(window).height(), eleOffsetTop = $(".counter_down").offset().top, eleTop = eleOffsetTop - winHeight, current = 0; $(window).on("scroll", function() { var scrollTop = $(window).scrollTop(); if (current == 0 && scrollTop >= eleTop) { load_js_move_number() } }); } });