// var gClickFlag = false; var gResizeInitCount = 0; function veo_commonInit() { var gIsAutoPlay = true; $.each($(".topSlider .sliderItem"), function(_i, _el){ if($(_el).find('.videoWrapper').data("video") !== undefined){ gIsAutoPlay = false; } }); $(".topSlider").slick ( { dots: true, infinite: true, speed: 300, slidesToShow: 1, adaptiveHeight: true, fade: true, autoplay: gIsAutoPlay, autoplaySpeed: 5000 } ); $(".topSlider").on ( "beforeChange", function(pEvent, pSlick, pCurrentSlide, pNextSlide) { var _video = $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".videoWrapper").data("video"); $(".topSlider").find(".sliderItem").removeClass("active"); $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").addClass("active"); updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]"), _video); } ); /* $(".topSlider").on ( "afterChange", function(pEvent, pSlick, pCurrentSlide) { } ); */ $(".topSlider").find(".sliderItem").removeClass("active"); $(".topSlider").find(".sliderItem[data-slick-index=0]").addClass("active"); updateSliderVideo($(".topSlider"), $(".topSlider").find(".sliderItem.active"), $(".topSlider").find(".sliderItem.active").find(".videoWrapper").data("video")); if ($(".gallerySlider").find(".sliderItem").length > 1) { _html = ''; _html += '
'; $(".gallerySlider").find(".sliderItem").each ( function (pIndex, pElement) { _html += '
'; _html += ''; _html += '
'; } ); _html += '
'; $(".galleryMessage").after($(_html)); } $(".gallerySlider").slick ( { dots: false, infinite: false, speed: 300, slidesToShow: 1, adaptiveHeight: false, fade: false, arrows: true, autoplay: false, autoplaySpeed: 5000, asNavFor: '.galleryThumbnailSlider' } ); if ($(".gallerySlider").find(".sliderItem").length > 1) { $(".galleryThumbnailSlider").slick ( { dots: false, infinite: false, speed: 300, slidesToShow: 3, adaptiveHeight: false, fade: false, arrows: false, centerMode: false, focusOnSelect: true, autoplay: false, autoplaySpeed: 5000, asNavFor: '.gallerySlider' } ); } $(".gallerySlider").on ( "beforeChange", function(pEvent, pSlick, pCurrentSlide, pNextSlide) { $(".gallerySlider").find(".sliderItem").removeClass("active"); $(".gallerySlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").addClass("active"); var _video = $(".gallerySlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]").find(".videoWrapper").data("video"); updateSliderVideo($(".gallerySlider"), $(".gallerySlider").find(".sliderItem[data-slick-index=" + pNextSlide + "]"), _video); } ); $(".gallerySlider").on ( "afterChange", function(pEvent, pSlick, pCurrentSlide) { var _msg = $(".gallerySlider").find(".sliderItem[data-slick-index=" + pCurrentSlide + "]").find(".message").html(); $(".galleryMessage").html(_msg); } ); $(".gallerySlider").find(".sliderItem").removeClass("active"); $(".gallerySlider").find(".sliderItem[data-slick-index=0]").addClass("active"); updateSliderVideo($(".gallerySlider"), $(".gallerySlider").find(".sliderItem.active"), $(".gallerySlider").find(".sliderItem.active").find(".videoWrapper").data("video")); $(".galleryMessage").html($(".gallerySlider").find(".sliderItem[data-slick-index=0]").find(".message").html()); $(window).on ( "resize", function(pEvent, pResponsive_str) { gResizeInitCount++; if ((gResizeInitCount < 2) || ($(window).width() != gDisplayWidth)) { gDisplayWidth = $(window).width(); $("html, body").removeClass("transitionFreeze").addClass("transitionFreeze"); if ($(".campusMenuWrapper").length > 0) { updateCampusMenu($(".campusMenuWrapper").find("#campusMenu_environment")); } if ($(".learningwithusMenuWrapper").length > 0) { updateLearningwithusMenu($(".learningwithusMenuWrapper").find("#campusMenu_environment")); } if ($(".tabMenuWrapper").length > 0) { if(gCurrentTab != '') { updateTabMenu(gCurrentTab); } // 20180115 call closeFaqItems() only when it is declared if (typeof closeFaqItems !== 'undefined' && typeof closeFaqItems === 'function') { closeFaqItems(); } } setTimeout ( function () { $("html, body").removeClass("transitionFreeze"); }, 10 ); } } ); } function veo_campusInit() { $(".campusMenu").find("input[type='radio']").on ( "change", function (pEvent) { updateCampusMenu($(pEvent.currentTarget)); } ); gDisplayWidth = $(window).width(); gCurrentCampusSection = $(".campusMenuWrapper").find("#campusMenu_environment").val(); $(".campusMenuWrapper").find("#campusMenu_environment").trigger("click"); updateCampusMenu($(".campusMenuWrapper").find("#campusMenu_environment")); } function veo_learningwithusInit() { $(".learningwithusMenu").find("input[type='radio']").on ( "change", function (pEvent) { updateLearningwithusMenu($(pEvent.currentTarget)); } ); gDisplayWidth = $(window).width(); gCurrentLearningwithusSection = $(".learningwithusMenuWrapper").find("#campusMenu_environment").val(); $(".learningwithusMenuWrapper").find("#campusMenu_environment").trigger("click"); } function updateSliderVideo(pSlider, pSliderItem, pVideo) { var _html = null; var _popVideoType = pSliderItem.data("type"); var _popVideo = pSliderItem.data("id"); _html = ''; if (pVideo != undefined) { if ($("body").hasClass("deviceDesktop")) { _html += ''; } } if ((_popVideoType != undefined) && (_popVideoType != "")) { _html += ''; } pSliderItem.find(".videoWrapper").html(_html); }