); if (hash != '') { var href_tab_params = $('a[href=' + hash + ']').attr('data-w-tab') if (href_tab_params == 'community-events') { var mainEventLeft = $('#smu2023_community_events').css('left'); } else if (href_tab_params == 'satellite-events') { var mainEventLeft = $('#smu2023_satellite_events').css('left'); } else { var mainEventLeft = $('#smu2023_main_events').css('left'); } } else { var mainEventLeft = $('#smu2023_main_events').css('left'); } $('#smu2023_event_tabs a').removeClass("w--current"); if ($(this).data('w-tab') == 'community-events') { $('#smu2023_community_events').show(); $('#smu2023_community_events').css({ left: mainEventLeft }); } else if ($(this).data('w-tab') == 'satellite-events') { $('#smu2023_satellite_events').show(); $('#smu2023_satellite_events').css({ left: mainEventLeft }); } else { $('#smu2023_main_events').css({ left: mainEventLeft }); $('#smu2023_main_events').show(); } } $(this).addClass("w--current"); }) let vid = document.getElementById("myVideo"); function playVid() { $("#video-container iframe")[0].src += "&autoplay=1"; } function pauseVid() { vid.pause(); } // const poster = document.querySelector("#video-container"); // poster.addEventListener("click", removePoster); const poster = document.querySelector("#video-container"); if (poster) { poster.addEventListener("click", removePoster); } function removePoster() { poster.classList.add("poster-active"); playVid(); } var $elementfirstScrollTop = $('.custom-container-video-festival'); if ($elementfirstScrollTop.length) { var firstScrollTop = $('.custom-container-video-festival').offset().top; var a=1; $(window).scroll(function(event) { if($(this).scrollTop()>=firstScrollTop){ a++; if(a==2){ removePoster() } } }); } var $select = $('.multiselect_custom'); $select.attr({ name: $select.attr('name') + '[]', size: 5, multiple: true }); $('.quform-form:not(.quform-form-2,.quform-form-15,.quform-form-16) input,.quform-form:not(.quform-form-2,.quform-form-15,.quform-form-16) textarea').attr({ 'onselectstart':'return false;' , 'onpaste':"return false;", 'onCopy':"return false", 'onCut':"return false", 'onDrag':"return false", 'onDrop':"return false", 'autocomplete':"off", 'role':"presentation" }) if (!isMobile3) { $('.program_block').hover(function () { $(this).parent().parent().css({ width: $(this).parent().width() + 30 + "px" }); $('.program_block').css({ 'border-bottom': 'none', width: $(this).parent().width() - 30 + "px" }); $(this).css({ 'border-bottom': 'none', width: $(this).parent().width() + 30 + "px" }); $(this).find('.program_img_main .elementor-image').css({ padding: 0 }); $(this).find('.program_img_main img').css({ 'max-width': $(this).find('.program_img_main img').width() + "px" }); $(this).css({ 'margin-left': '-30px' }); $(this).find('.program_img_main .elementor-image').css({ 'margin-left': '30px' }); $(this).find('.program_content').css({ 'padding-left': '30px', 'padding-right': '30px' }); }, function () { $(this).css({ 'margin-left': '0' }); $(this).find('.elementor-image').css({ 'margin-left': '0' }); $(this).find('.program_img_main').find('.elementor-image').css({ 'margin-left': '0' }); $(this).find('.program_img_main img').css({ 'max-width': "100%" }); $(this).find('.program_img_main').css({ width: '37%' }); $(this).find('.program_content').css({ 'padding-left': '0', 'padding-right': '60px' }); $('.program_block').css({ 'border-bottom': '1px solid #d9d9d9' }); $(this).parent().parent().css({ width: '100%' }); }) } const smu2023MenuPosition = $('#smu2023-menu').position(); const smu2023MenuLeft = smu2023MenuPosition ? smu2023MenuPosition.left : 0; const smu2023MenuTop = smu2023MenuPosition ? smu2023MenuPosition.top : 0; const smu2023MenuOffset = $('#smu2023-menu')?.offset()?.top || 0; const hasTabs = $('#smu2023_event_tabs').length == 0 ? false : true; let smu2023EventTabsLeft = 0; let smu2023EventTabsTop = 0; let smu2023EventTabsPosition = 0; let smu2023EventTabsOffset = 0; if (hasTabs) { smu2023EventTabsPosition = $('#smu2023_event_tabs').position(); smu2023EventTabsLeft = smu2023EventTabsPosition.left smu2023EventTabsTop = smu2023EventTabsPosition.top smu2023EventTabsOffset = $('#smu2023_event_tabs').offset().top } $(window).scroll(function () { if ($('#smu2023-menu').length > 0) { var stickyMenu = $(window).scrollTop() > 300 && $(window).scrollTop() >= $('#smu2023-menu').position().top - $('#smu2023-menu').height() - 110 } const tabletStickyMenu = $('#startmeuphk-festival-2023').length > 0 ? $(window).scrollTop() > 350 : $(window).scrollTop() > 300 const mobileStickyMenu = $('#startmeuphk-festival-2023').length > 0 ? $(window).scrollTop() > 330 : $(window).scrollTop() > 190 // console.log('mobileStickyMenu',mobileStickyMenu) // console.log('startmeuphk-festival-2023 length',$('#startmeuphk-festival-2023').length) // console.log('window scrollTop',$(window).scrollTop()) // console.log('#smu2023-menu offset', $('#smu2023-menu').position().top) // console.log('#smu2023-menu height', $('#smu2023-menu').height()) //const stickyMenu = isMobile3? $(window).scrollTop() > 200 : $(window).scrollTop() > smu2023MenuOffset-$('#smu2023-menu').height()-76 $('#startmeuphk-festival-2023-programme .scroll-watch-placeholder,#startmeuphk-festival-2023-partners .scroll-watch-placeholder,#startmeuphk-festival-2023 .scroll-watch-placeholder').show(); if (isTablet) { if (tabletStickyMenu) { $('#smu2023-menu').css({ position: 'fixed', left: 0, top: '140px', 'z-index': '9999999999999' }); if (hasTabs) $('#smu2023_event_tabs').css({ position: 'fixed', left: 0, 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() } }); } });