$.fn.isOnScreen = function(){ var win = $(window); var viewport = { top : win.scrollTop(), left : win.scrollLeft() }; viewport.right = viewport.left + win.width(); viewport.bottom = viewport.top + win.height(); var bounds = this.offset(); bounds.right = bounds.left + this.outerWidth(); bounds.bottom = bounds.top + this.outerHeight(); return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); }; var helper = { equal: function(group) { group.height('auto'); tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest) tallest = thisHeight; }); group.height(tallest); }, }; $(function() { $('.nav .dropdown, .language.dropdown').hover(function(e) { if ( Modernizr.mq('only screen and (min-width: 768px)') ) { e.preventDefault(); $('.dropdown-toggle', this).trigger('click'); } }); $('.nav .dropdown .dropdown-toggle, .language.dropdown .dropdown-toggle').on('click', function(event) { if ( Modernizr.mq('only screen and (min-width: 768px)') ) { if( event.hasOwnProperty('originalEvent') ) { event.stopPropagation(); } } }); }); $(function() { $('footer .back-to-top').on('click', function(e) { e.preventDefault(); $('html, body').animate({scrollTop: 0}, 500); }); }); $(function() { if ( !(window.mozInnerScreenX == null) ) { $('.page-about-us-events .section-information .title .bullet').addClass('firefox'); } }); $(function() { $(window).resize(function() { if ( Modernizr.mq('only screen and (min-width: 768px)') ) { helper.equal($('.section-work .col-sm-4')); } else if ( !Modernizr.mq('only all') ) { helper.equal($('.section-work .col-sm-4')); } else { $('.section-work .col-sm-4').css('height', 'auto'); } }); setTimeout(function() { $(window).resize(); }, 500); setTimeout(function() { $(window).resize(); }, 750); setTimeout(function() { $(window).resize(); }, 1000); }); $(function() { $(window).resize(function() { helper.equal($('.page-product-vo .middle-table-col')); helper.equal($('.page-product-vo .bottom-box-item .inner-item')); helper.equal($('.page-product-index .blk')); }); setTimeout(function() { $(window).resize(); }, 500); setTimeout(function() { $(window).resize(); }, 750); setTimeout(function() { $(window).resize(); }, 1000); }) $(function() { $('.main-columnize').columnize({ columns: 2, lastNeverTallest: true }); }); $(function() { // $(window).resize(function() { // var paddingLeft = $('.content-container').css('padding-left'); // var marginLeft = $('.content-container').css('margin-left'); // var offset = parseFloat(paddingLeft) + parseFloat(marginLeft); // // $('.page-about-us-our-services .section-smm .smm-item .destinations .desktop-image').css('margin-left', '-' + offset + 'px'); // }); // // $(window).resize(); }); $(function() { var styles = [ { "stylers": [ { "saturation": -100 } ] } ]; $('.map-canvas').each(function(index, el) { var $el = $(el); var id = $el.attr('id'); var lat = $el.attr('data-lat'); var lng = $el.attr('data-lng'); var overlay = $el.attr('data-overlay'); var map = new GMaps({ div: id, lat: lat, lng: lng, draggable: false, scrollwheel: false, }); map.addStyle({ styledMapName: '', styles: styles, mapTypeId: 'map_style' }); map.setStyle('map_style'); map.addMarker({ lat: lat, lng: lng, icon: 'img/marker.png' }); map.drawOverlay({ lat: lat, lng: lng, content: '
' + overlay + '
', verticalAlign: 'top', verticalOffset: -60, horizontalOffset: -32, }); }); }); $(function() { $('#job-table').DataTable({ "bPaginate": false, "bLengthChange": false, "bFilter": false, "bInfo": false, "bAutoWidth": false, "order": [] }); }); $(function() { $('.date-of-birth-select').datepicker({ format: 'dd/mm/yyyy', }) }); $(function() { $('.form-criminal .form-criminal-answer').on('click', function() { $('.form-criminal-answer').removeClass('active'); $(this).addClass('active'); var value = $(this).attr('data-value'); $(this).parent().parent().find('input[name="Application\[criminal_conviction\]"]').val(value); }); }); $(function() { if ( $('html').hasClass('ie8') || !Modernizr.csstransitions ) { $('.jump-1 .begin, .jump-1 .inter-1, .jump-1 .inter-2, .jump-1 .inter-3, .jump-1 .text').css({ opacity: 1 }); $('.jump-2 .begin, .jump-2 .inter-1, .jump-2 .inter-2, .jump-2 .inter-3, .jump-2 .text').css({ opacity: 1 }); $('.jump-3 .begin, .jump-3 .inter-1, .jump-3 .inter-2, .jump-3 .inter-3, .jump-3 .text').css({ opacity: 1 }); $('.jump-4 .begin, .jump-4 .inter-1, .jump-4 .inter-2, .jump-4 .inter-3, .jump-4 .text').css({ opacity: 1 }); $('.jump-5 .begin, .jump-5 .inter-1, .jump-5 .inter-2, .jump-5 .inter-3, .jump-5 .text').css({ opacity: 1 }); $('.jump-6 .begin, .jump-6 .inter-1, .jump-6 .inter-2, .jump-6 .inter-3, .jump-6 .text').css({ opacity: 1 }); $('.bounce').css('width', 'auto'); } else { if ( $('.jump-container').length ) { if ( $('.jump-container').isOnScreen() ) { animateJump(); $.fn.isOnScreen = function() {}; } } } $(window).scroll(function() { if ( $('.jump-container').length ) { if ( $('.jump-container').isOnScreen() ) { animateJump(); $.fn.isOnScreen = function() {}; } } }); function animateJump() { resetAnimateJump(); setTimeout(function() { animateJump1(); }, 2500); } function resetAnimateJump() { $('.jump-1 .begin, .jump-1 .inter-1, .jump-1 .inter-2, .jump-1 .inter-3, .jump-1 .text').stop(true, true); $('.jump-2 .begin, .jump-2 .inter-1, .jump-2 .inter-2, .jump-2 .inter-3, .jump-2 .text').stop(true, true); $('.jump-3 .begin, .jump-3 .inter-1, .jump-3 .inter-2, .jump-3 .inter-3, .jump-3 .text').stop(true, true); $('.jump-4 .begin, .jump-4 .inter-1, .jump-4 .inter-2, .jump-4 .inter-3, .jump-4 .text').stop(true, true); $('.jump-5 .begin, .jump-5 .inter-1, .jump-5 .inter-2, .jump-5 .inter-3, .jump-5 .text').stop(true, true); $('.jump-6 .begin, .jump-6 .inter-1, .jump-6 .inter-2, .jump-6 .inter-3, .jump-6 .text').stop(true, true); $('.bounce').stop(true, true); $('.jump-1 .begin, .jump-1 .inter-1, .jump-1 .inter-2, .jump-1 .inter-3, .jump-1 .text').css({ opacity: 0 }); $('.jump-2 .begin, .jump-2 .inter-1, .jump-2 .inter-2, .jump-2 .inter-3, .jump-2 .text').css({ opacity: 0 }); $('.jump-3 .begin, .jump-3 .inter-1, .jump-3 .inter-2, .jump-3 .inter-3, .jump-3 .text').css({ opacity: 0 }); $('.jump-4 .begin, .jump-4 .inter-1, .jump-4 .inter-2, .jump-4 .inter-3, .jump-4 .text').css({ opacity: 0 }); $('.jump-5 .begin, .jump-5 .inter-1, .jump-5 .inter-2, .jump-5 .inter-3, .jump-5 .text').css({ opacity: 0 }); $('.jump-6 .begin, .jump-6 .inter-1, .jump-6 .inter-2, .jump-6 .inter-3, .jump-6 .text').css({ opacity: 0 }); $('.bounce').css({ width: 0 }); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 50); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 100); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 200); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 250); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 500); setTimeout(function() { $('.bounce').css({ width: 0 }); }, 750); } function animateJump1() { $('.jump-1 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-1 .inter-1').animate({ opacity: 1 }, 700, function() { $('.jump-1 .inter-2').animate({ opacity: 1 }, 700, function() { $('.jump-1 .inter-3').animate({ opacity: 1 }, 700, function() { animateJump2(); }); }); }); $('.jump-1 .text').animate({ opacity: 1 }, 1000, function() { }); }); $('.jump-1 .bounce').animate({ width: '500px' }, 11000); } function animateJump2() { $('.jump-2 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-2 .inter-1').animate({ opacity: 1 }, 700, function() { $('.jump-2 .inter-2').animate({ opacity: 1 }, 700, function() { $('.jump-2 .inter-3').animate({ opacity: 1 }, 700, function() { animateJump3(); }); }); }); $('.jump-2 .text').animate({ opacity: 1 }, 1000, function() { }); }); $('.jump-2 .bounce').animate({ width: '500px' }, 11000); } function animateJump3() { $('.jump-3 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-3 .inter-1').animate({ opacity: 1 }, 700, function() { $('.jump-3 .inter-2').animate({ opacity: 1 }, 700, function() { $('.jump-3 .inter-3').animate({ opacity: 1 }, 700, function() { animateJump4(); }); }); }); $('.jump-3 .text').animate({ opacity: 1 }, 1000, function() { }); }); $('.jump-3 .bounce').animate({ width: '500px' }, 11000); } function animateJump4() { $('.jump-4 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-4 .inter-1').animate({ opacity: 1 }, 700, function() { $('.jump-4 .inter-2').animate({ opacity: 1 }, 700, function() { $('.jump-4 .inter-3').animate({ opacity: 1 }, 700, function() { animateJump5(); }); }); }); $('.jump-4 .text').animate({ opacity: 1 }, 1000, function() { }); }); $('.jump-4 .bounce').animate({ width: '500px' }, 8000); } function animateJump5() { $('.jump-5 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-5 .inter-1').animate({ opacity: 1 }, 700, function() { $('.jump-5 .inter-2').animate({ opacity: 1 }, 700, function() { $('.jump-5 .inter-3').animate({ opacity: 1 }, 700, function() { animateJump6(); }); }); }); $('.jump-5 .text').animate({ opacity: 1 }, 1000, function() { }); }); $('.jump-5 .bounce').animate({ width: '500px' }, 8000, function() { animateJump(); }); } function animateJump6() { $('.jump-6 .begin').animate({ opacity: 1 }, 700, function() { $('.jump-6 .text').animate({ opacity: 1 }, 700, function() { // animateBounce(); }); }); } }); $(function() { $('footer .divide-right-form button[type="submit"]').on('click', function(e) { e.preventDefault(); var name = $('footer .divide-right-form input[name="name"]').val(); var email = $('footer .divide-right-form input[name="email"]').val(); var subject = $('footer .divide-right-form input[name="subject"]').val(); var message = $('footer .divide-right-form textarea[name="message"]').val(); $.ajax({ type: 'POST', url: Site.enquirySendUrl, data: { name: name, email: email, subject: subject, message: message, 'YII_CSRF_TOKEN': Site.csrfToken, }, success: function(data) { alert(data.message); } }); }); }); var i = 0; var c = 0; $(function() { if ( $('.page-career-development').length <= 0 ) { return; } $(window).on("resize", function () { var windowsize = $(this).width(); if (windowsize > 1429 && c == 1) { location.reload(); } else if (windowsize > 1429 && i == 0) { i = 1; } else if (windowsize <= 1429 && i == 1) { location.reload(); i = 0; } else if (windowsize <= 1429 && i == 0) { c = 1; } }); });