AIR 7 SEAS - Logistics, Freight Forwarder Network, Shipping, NVOCC, Cargo Consolidator, OTI, Carrier, Transporter,
Posted on: Saturday, April 16th, 2022 | ID: #883


1) { VPHomeSlider.startTimer(); VPHomeSlider.animateProgressBar(0); } }, startTimer: function () { if (firstRun == true) { currentSlideHC = 1; } firstRun = false; timerHomeCarousel = setInterval(function () { VPHomeSlider.showClickedSlide(currentSlideHC); }, slideChangeTimeHC); }, resetTimer: function () { clearInterval(timerHomeCarousel); VPHomeSlider.startTimer(); }, generateNavigation: function () { var $sliderItem = $(“.VPSliderItem”, $HomeBannerCarousel) var $listContainer = $(“.tab_buttons ul”, $HomeBannerCarousel); noOfSlides = $sliderItem.length; for (var i = 0; i < noOfSlides; i++) { var tempButtonTextTop = $sliderItem.eq(i).attr("data-navigationText"); var tempButtonTextBottom = $sliderItem.eq(i).attr("data-navText"); var $buttonForBottomPanel = $("

  • ” + “” + “” + tempButtonTextTop + “]]>
  • ” + “

    ” + tempButtonTextBottom + “

    ” + ”); $listContainer.append($buttonForBottomPanel); } var navigationItemWidth = $listContainer.width(); navigationItemWidth = navigationItemWidth / noOfSlides; $(“li”, $listContainer).width(Math.floor(navigationItemWidth)); $(“li”, $listContainer).first().addClass(“buttonActive”); $(“li .activearrow”, $listContainer).first().css(“display”, “block”); //$(“#VPSliderNavigation ul li”).last().css(“border-right”, “none”); }, registerNavigation: function () { $HomeBannerCarousel.delegate(“.tab_button”, “click”, function () { var slide = $(this).index() – 1; currentSlideHC = slide; if ($(this).hasClass(“buttonActive”)) { return; } VPHomeSlider.showClickedSlide(slide + 1); VPHomeSlider.highlightSelected(currentSlideHC); VPHomeSlider.animateProgressBar(currentSlideHC); VPHomeSlider.updateSlideCount(); VPHomeSlider.resetTimer(); }); }, showClickedSlide: function (slideCounter) { var $sliderItem = $(“.VPSliderItem”, $HomeBannerCarousel) var requiredSlide = $sliderItem.eq(slideCounter); $sliderItem.not(“currentItem”).hide().css(“z-index”, “1”); requiredSlide.css(“z-index”, “4”); var $currentItem = $(“.currentItem”, $HomeBannerCarousel); $currentItem.hide(); requiredSlide.fadeIn(400); $currentItem.removeClass(“currentItem”).css(“z-index”, “1”).hide(); requiredSlide.addClass(“currentItem”).css(“z-index”, “5”); VPHomeSlider.highlightSelected(currentSlideHC); VPHomeSlider.animateProgressBar(currentButtonHC); VPHomeSlider.updateSlideCount(); var pnlSliderHgt = $(‘#pnlSlider’).height(); //grab IDs of slider in virtual array var VPSliderItem = []; var CountDownDivId = []; var allCss = []; var BannerStyle = []; //assign IDS to VPSliderItem array $(‘#VPSliderNavigation’).find(‘span’).each(function (i) { VPSliderItem.push($(this).attr(‘id’)); }); $(‘#VPSliderNavigation’).find(‘.counter’).each(function (i) { CountDownDivId.push($(this).attr(‘id’)); }); $(‘#allCss’).each(function (i) { allCss.push($(this).html()); }); $(‘#bannerStyle’).find(‘div’).each(function (i) { BannerStyle.push($(this).attr(‘id’)); }); //sliderItem each loop to add remove class to countdown wrapper $($sliderItem).each(function (i) { var Divid = CountDownDivId[i]; if (BannerStyle[i]) { var spilt1 = document.getElementById(BannerStyle[i]).innerHTML; if (spilt1) { var SplitText = spilt1.split(‘^’); BannerCountDownStyle(Divid, SplitText[0], SplitText[1], SplitText[2], SplitText[3]); } if (BannerStyle[i] == “BannerCountDown_0_1”) { if (BannerStyle[i] == “BannerCountDown_0_1”) { $(“#spnVImg_0”).addClass(“play-video-img”); $(“#spnVImg_0”).addClass(“LT200”); } else { $(“#spnVImg_1”).removeClass(“play-video-img”); $(“#spnVImg_2”).removeClass(“play-video-img”); $(“#spnVImg_3”).removeClass(“play-video-img”); } } else { $(“#spnVImg_1”).removeClass(“play-video-img”); $(“#spnVImg_2”).removeClass(“play-video-img”); $(“#spnVImg_3”).removeClass(“play-video-img”); } } }) }, highlightSelected: function (button) { var $listItem = $(“li”, $HomeBannerCarousel); var $activeRow = $(“.activearrow”, $HomeBannerCarousel); $listItem.removeClass(“buttonActive”); $activeRow.css(“display”, “none”); $listItem.eq(button).addClass(“buttonActive”); $activeRow.eq(button).css(“display”, “block”); currentButtonHC = $(“.buttonActive”).index(); }, animateProgressBar: function (currentButtonHC) { var $progressBar = $(“.progressBar”, $HomeBannerCarousel); var $btnActive = $(“.buttonActive”, $HomeBannerCarousel); $progressBar.stop(true, true).width(0); var progressBarWidth = ($btnActive.width() + parseInt($btnActive.css(“padding-left”).replace(“px”, “”)) + parseInt($btnActive.css(“padding-right”).replace(“px”, “”))); $progressBar.eq(currentButtonHC).animate({ width: progressBarWidth }, slideChangeTimeHC, function () { $(this).fadeOut(function () { $(this).width(0).fadeIn(0); }); } ); }, updateSlideCount: function () { if (currentSlideHC == noOfSlides – 1) { currentSlideHC = 0; } else { currentSlideHC++; } } }; $(document).ready(function () { VPHomeSlider.init(); });

    Source