$(function(){ /* On page scroll ----------------------------------------*/ pageScroll(); $(document).on("scroll", function() { pageScroll(); }); function pageScroll() { /* Display back to top button */ if($(document).scrollTop() > 300) { $(".back-to-top").stop().fadeIn("fast"); } else { $(".back-to-top").stop().fadeOut("fast"); } } /* Back to top button action ----------------------------------------*/ $(".back-to-top").on("click", function() { $("html, body").animate({ scrollTop: "0", }); }); /* Mobile menu ----------------------------------------*/ $('#polux-multilevelpushmenu').multilevelpushmenu({ menuID: 'div_multilevelpushmenu', container: $('#polux-multilevelpushmenu'), containersToPush: [$('.container'), $('#polux-multilevelpushmenu-expand')], collapsed: true, fullCollapse: true, backItemIcon: 'fas fa-chevron-left', groupIcon: 'fas fa-chevron-right', menuWidth: '80%', menuHeight: '100%', onItemClick: function() { location.href = arguments[2].find('a:first').attr('href'); } }); $('#polux-multilevelpushmenu-expand').click(function(){ if($('#polux-multilevelpushmenu').multilevelpushmenu('menuexpanded', $('#polux-multilevelpushmenu').multilevelpushmenu('activemenu'))){ $('#polux-multilevelpushmenu').multilevelpushmenu('collapse'); } else { $('#polux-multilevelpushmenu').multilevelpushmenu('expand'); } }); /* Disable # links ----------------------------------------*/ $('a[href="#"]').on("click", function(event) { event.preventDefault(); }); /* Hero overlay arrow ----------------------------------------*/ $('.hero-overlay-arrow a[href="#"], .content-text-arrow a[href="#"]').on("click", function(event) { console.log('scroll'); $("html, body").animate({ scrollTop: $(".main").offset().top, }); }); /* Submit contact form ----------------------------------------*/ $('form.post_form').submit(function(event) { event.preventDefault(); $(this).prop('disabled', true); var form = $(this).closest('form'); var url = form.attr("action"); var data = form.serialize(); var formHeight = form.height(); var formWidth = form.width(); form.hide(); var messageClass = 'formMessage'+Math.floor(Math.random()*(9999-1000))+9999; $('
Please wait...
').insertAfter(form); messageClass = '.'+messageClass; $(messageClass).css('display', 'table'); $(messageClass).css('width', '100%'); $(messageClass).css('height', formHeight); $(messageClass+' div').css('display', 'table-cell'); $(messageClass+' div').css('vertical-align', 'middle'); $(messageClass+' p').css('margin', '0'); $.ajax({ method: 'POST', url: url, data: data, dataType: 'json', success: function(data){ setTimeout(function() { $(messageClass+' i').hide(); $(messageClass+' p').html(data.message); if(data.success == false) { setTimeout(function() { $(messageClass).hide(); form.fadeIn(1000); }, 2000); } }, 1000); } }); }); /* Solutions gallery ----------------------------------------*/ $('.solutions-gallery .solutions-gallery-item').hoverIntent(function() { var slideHeight = $(this).find('.slide').height()/2; //var vw = ($(document).width()/100)*5; var slideto = 180; $(this).addClass('active'); $(this).find('.slide').animate({ //top: -(slideHeight-vw) top: -slideto }, 250); }, function() { $(this).removeClass('active'); $( this ).find('.slide').animate({ top: '0' }, 250); } ); /* Solutions icons ----------------------------------------*/ $('.solutions-icons .solutions-icon-item').hover(function() { var image = $(this).find('.solutions-icon-image'); var bg = image.data('hover-background'); image.css('background-image', 'url(' + bg + ')'); }, function() { var image = $(this).find('.solutions-icon-image'); var bg = image.data('standard-background'); image.css('background-image', 'url(' + bg + ')'); } ); /* Video header text animation ----------------------------------------*/ var videoOverlay = anime.timeline({ loop: true, easing: 'linear', duration: 800, /* All animations take 800 millisecond */ }); /* Softworx Logo */ videoOverlay.add({ targets: '.hero-overlay-animation .slide1 img', opacity: 1, /* Fade in the logo */ }).add({ targets: '.hero-overlay-animation .slide1 img', offset: '+=1000', /* Show logo for 1 second */ opacity: 0, /* Fade out the logo */ }); /* '1 GOAL' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide2', offset: '+=1000', opacity: 1, /* Fade in the text */ }).add({ targets: '.hero-overlay-animation .slide2', offset: '+=1000', /* Show text for 1 second */ opacity: 0, /* Fade out the text */ }); /* 'To make your business better' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide3', offset: '+=1000', opacity: 1, /* Fade in the text */ top: ['70%', '50%'] /* Move text */ }).add({ targets: '.hero-overlay-animation .slide3', offset: '+=2000', /* Show text for 2 second */ opacity: 0, /* Fade out the text */ }); /* '3 CAPABILITIES' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide4', offset: '+=1000', opacity: 1, /* Fade in the text */ }).add({ targets: '.hero-overlay-animation .slide4', offset: '+=3000', /* Show text for 3 second */ opacity: 0, /* Fade out the text */ }); /* 'Connect - Secure - Transform' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide5', offset: '+=1000', opacity: 1, /* Fade in the text */ top: ['70%', '50%'] /* Move text */ }).add({ targets: '.hero-overlay-animation .slide5', offset: '+=3000', /* Show text for 3 second */ opacity: 0, /* Fade out the text */ }); /* '5 BUSINESS OUTCOMES' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide6', offset: '+=1000', opacity: 1, /* Fade in the text */ }).add({ targets: '.hero-overlay-animation .slide6', offset: '+=3000', /* Show text for 3 second */ opacity: 0, /* Fade out the text */ }); /* 'Cost reduction...' */ videoOverlay.add({ targets: '.hero-overlay-animation .slide7', offset: '+=1000', opacity: 1, /* Fade in the text */ top: ['70%', '50%'] /* Move text */ }).add({ targets: '.hero-overlay-animation .slide7', offset: '+=8000', /* Show text for 3 second */ opacity: 0, /* Fade out the text */ }); /* Main carousel ----------------------------------------*/ $('.partner-carousel').slick({ accessibility: false, autoplay: true, autoplaySpeed: 5000, //arrows: false, dots: false, draggable: false, /*fade: true,*/ infinite: true, pauseOnFocus: false, pauseOnHover: false, speed: 800, swipe: false, touchMove: false, slidesToShow: 3, slidesToScroll: 3, responsive: [ { breakpoint: 640, settings: { slidesToShow: 2, slidesToScroll: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1, slidesToScroll: 1 } } ] }); /* Select (jQuery select2) ----------------------------------------*/ $('.form-standard form select').each(function() { $(this).select2({ minimumResultsForSearch: -1, placeholder: $(this).data('placeholder'), width: '100%', closeOnSelect: false }); }); /* Fix grid ----------------------------------------*/ for(i = 0; i < 3; i++) { //setTimeout(gridFix, 100); } $(window).resize(function () { //gridFix(); }); }); $(window).resize(function () { $('#polux-multilevelpushmenu').multilevelpushmenu('redraw'); }); $.fn.preload = function() { this.each(function(){ $('
')[0].src = this; }); } function gridFix() { if($(window).width() < 992) { $('.polluxgrid').each(function() { $(this).css('width', ''); }); } else { $('.polluxgrid').each(function() { $(this).css('width', ''); gridWidth = $(this).outerWidth() + 30; $(this).css('width', gridWidth); }); } }
//$(function(){ //});
$(function(){ /* Preload hover icons */ var preload = []; $('.solutions-icons .solutions-icon-image').each(function () { preload.push($(this).data('hover-background')); }); $(preload).preload(); });
/*$(function(){ });*/
$(function(){ /* Preload hover icons */ var preload = []; $('.solutions-icons .solutions-icon-image').each(function () { preload.push($(this).data('hover-background')); }); $(preload).preload(); });
/*$(function(){ });*/
$(function(){ $(".action-showmore").on("click", function() { var start = $(".action-showmore").data('start'); $.ajax({ method: 'GET', url: '/articles/', data: {start: start, count: '6'}, dataType: 'json', success: function(returnData){ $(".action-showmore").data('start', start + 6); var output = ""; if(typeof returnData[0] !== 'undefined') { output = "
"; if(typeof returnData[0] !== 'undefined') output = output + showmoreHTML(returnData[0].title,returnData[0].preview,returnData[0].image,returnData[0].slug); if(typeof returnData[1] !== 'undefined') output = output + showmoreHTML(returnData[1].title,returnData[1].preview,returnData[1].image,returnData[1].slug); if(typeof returnData[2] !== 'undefined') output = output + showmoreHTML(returnData[2].title,returnData[2].preview,returnData[2].image,returnData[2].slug); output = output + "
"; } if(typeof returnData[3] !== 'undefined') { output = output + "
"; if(typeof returnData[3] !== 'undefined') output = output + showmoreHTML(returnData[3].title,returnData[3].preview,returnData[3].image,returnData[3].slug); if(typeof returnData[4] !== 'undefined') output = output + showmoreHTML(returnData[4].title,returnData[4].preview,returnData[4].image,returnData[4].slug); if(typeof returnData[5] !== 'undefined') output = output + showmoreHTML(returnData[5].title,returnData[5].preview,returnData[5].image,returnData[5].slug); output = output + "
"; } if(typeof returnData[0] !== 'undefined') { $(".article-group .articles").append(output); $("html, body").animate({ scrollTop: $("html").scrollTop()+400, }); } else { output = '
No more articles found.
'; $(".article-group").append(output); $(".action-showmore").hide(); } } }); }); }); function showmoreHTML(title,preview,image,slug) { var output = '
' + '
' + '
'+title+'
' + '
'+preview+'
' + '' + '
'; return output; }
/*$(function(){ });*/
//$(function(){ //});