$("#introModal").modal("show"); var swiper = new Swiper(".intro-slider", { slidesPerView: 1, spaceBetween: 0, loop: false, speed: 1200, autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: ".swiper-pagination", clickable: true, }, breakpoints: { 0: { speed: 400, }, 575: {}, 767: {}, 991: {}, 1199: {}, }, }); $(".voteView").click(function () { var voteTitle = $(this).attr("rel"); chart = $(".chart").html(); // alert(chart); $.fancybox.open(chart); // alert(datachart); jQuery.jqplot("chart2", [datachart], { // title: voteTitle, seriesDefaults: { shadow: false, renderer: jQuery.jqplot.PieRenderer, rendererOptions: { padding: 2, sliceMargin: 2, showDataLabels: true }, }, legend: { show: true, location: "e", renderer: $.jqplot.EnhancedPieLegendRenderer, }, grid: { drawBorder: false, drawGridlines: false, background: "#ffffff", shadow: false, }, }); }); function Purchase(subject) { $("#titlepu").html(subject); } $(document).ready(function () { var slideWrapper = $(".main-slider"), iframes = slideWrapper.find(".embed-player"), lazyImages = slideWrapper.find(".slide-image"), lazyCounter = 0; // POST commands to YouTube or Vimeo API function postMessageToPlayer(player, command) { if (player == null || command == null) return; player.contentWindow.postMessage(JSON.stringify(command), "*"); } // When the slide is changing function playPauseVideo(slick, control) { var currentSlide, slideType, startTime, player, video; currentSlide = slick.find(".slick-current"); slideType = currentSlide.attr("class").split(" ")[1]; player = currentSlide.find("iframe").get(0); startTime = currentSlide.data("video-start"); if (slideType === "vimeo") { switch (control) { case "play": if ( startTime != null && startTime > 0 && !currentSlide.hasClass("started") ) { currentSlide.addClass("started"); postMessageToPlayer(player, { method: "setCurrentTime", value: startTime, }); } postMessageToPlayer(player, { method: "play", value: 1, }); break; case "pause": postMessageToPlayer(player, { method: "pause", value: 1, }); break; } } else if (slideType === "youtube") { switch (control) { case "play": postMessageToPlayer(player, { event: "command", func: "playVideo", }); postMessageToPlayer(player, { event: "command", func: "playVideo", }); break; case "pause": postMessageToPlayer(player, { event: "command", func: "stopVideo", }); break; } } else if (slideType === "video") { video = currentSlide.children("video").get(0); if (video != null) { if (control === "play") { video.play(); } else { video.pause(); } } } } // Resize player function resizePlayer(iframes, ratio) { if (!iframes[0]) return; var win = $(".main-slider"), width = win.width(), playerWidth, height = win.height(), playerHeight, ratio = ratio || 16 / 9; iframes.each(function () { var current = $(this); // if (width / ratio < height) { // playerWidth = Math.ceil(height * ratio); // current.width(playerWidth).height(height).css({ // left: (width - playerWidth) / 2, // top: 0 // }); // } else { // playerHeight = Math.ceil(width / ratio); // current.width(width).height(playerHeight).css({ // left: 0, // top: (height - playerHeight) / 2 // }); // } }); } // DOM Ready $(function () { // Initialize slideWrapper.on("init", function (slick) { slick = $(slick.currentTarget); setTimeout(function () { playPauseVideo(slick, "play"); }, 1000); resizePlayer(iframes, 16 / 9); }); slideWrapper.on("beforeChange", function (event, slick) { slick = $(slick.$slider); playPauseVideo(slick, "pause"); }); slideWrapper.on("afterChange", function (event, slick) { slick = $(slick.$slider); playPauseVideo(slick, "play"); }); slideWrapper.on("lazyLoaded", function (event, slick, image, imageSource) { lazyCounter++; if (lazyCounter === lazyImages.length) { lazyImages.addClass("show"); // slideWrapper.slick("slickPlay"); } }); //start the slider slideWrapper.slick({ // fade:true, autoplay: true, autoplaySpeed: 4000, // lazyLoad: "progressive", speed: 600, arrows: false, dots: true, // dots:false, // cssEase: "cubic-bezier(0.87, 0.03, 0.41, 0.9)", }); }); // Resize event $(window).on("resize.slickVideoPlayer", function () { resizePlayer(iframes, 16 / 9); }); }); $(document).ready(function () { $(".wg-emagazine .slider").slick({ slidesToShow: 5, slidesToScroll: 1, dots: true, arrows: false, responsive: [ { breakpoint: 1201, settings: { slidesToShow: 4, }, }, { breakpoint: 769, settings: { slidesToShow: 3, }, }, { breakpoint: 577, settings: { slidesToShow: 2, }, }, { breakpoint: 402, settings: { slidesToShow: 1, }, }, ], }); $(".wg-emagazine .slider2").slick({ slidesToShow: 1, slidesToScroll: 1, dots: true, arrows: false, responsive: [ { breakpoint: 992, settings: { slidesToShow: 4, }, }, { breakpoint: 768, settings: { slidesToShow: 3, }, }, { breakpoint: 576, settings: { slidesToShow: 2, }, }, ], }); $(".purchase-pin .attach-list .owl-carousel").owlCarousel({ items: 2, loop: false, margin: 0, nav: true, dots: true, center: false, smartSpeed: 600, autoplay: false, slideBy: 1, responsive: { 1199: { items: 2, }, 767: { items: 2, }, 575: { items: 1, }, 414: { items: 1, }, 375: { items: 1, }, }, }); $(".wg-purchase .slider").slick({ slidesToShow: 5, slidesToScroll: 1, dots: true, arrows: false, responsive: [ { breakpoint: 1201, settings: { slidesToShow: 4, }, }, { breakpoint: 769, settings: { slidesToShow: 3, }, }, { breakpoint: 577, settings: { slidesToShow: 2, }, }, { breakpoint: 402, settings: { slidesToShow: 1, }, }, ], }); $(".wg-highlight-project .slider").slick({ slidesToShow: 3, slidesToScroll: 1, dots: false, arrows: false, responsive: [ { breakpoint: 769, settings: { slidesToShow: 2, }, }, { breakpoint: 579, settings: { slidesToShow: 1, }, }, ], }); $(".wg-hilight-project .slider").slick({ slidesToShow: 3, slidesToScroll: 1, autoplay: true, dots: true, arrows: false, infinite: false, responsive: [ { breakpoint: 990, settings: { slidesToShow: 2, }, }, { breakpoint: 579, settings: { slidesToShow: 1, }, }, ], }); });