// Created by - Vadim Lee // email: vadimlee042594@gmail.com $(".bg-item").each(function () { var attr = $(this).attr('data-image-src'); if (typeof attr !== typeof undefined && attr !== false) { $(this).css('background-image', 'url(' + attr + ')'); } }); $('.scrollbox-container').scrollbox({ direction: 'h', autoPlay: false, onMouseOverPause: false, listElement: '.scrollbox', listItemElement: '.element' }); $('.scrollbox-slider > .control.backward').click(function () { $(this).parent().find(".scrollbox-container").trigger('backward'); }); $('.scrollbox-slider > .control.forward').click(function () { $(this).parent().find(".scrollbox-container").trigger('forward'); }); $(function () { // Mobile--------------- var isMobile = false; if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i)) { isMobile = true; } // END Mobile--------------- // ANIMATED if (isMobile == false) { $('*[data-animated]').addClass('animated'); $('*[data-animated]').css('opacity', '0'); } function animatedContents() { $(".animated:appeared").each(function (i) { var $this = $(this), animated = $(this).data('animated'); setTimeout(function () { $this.css('opacity', ''); $this.addClass(animated); }, 100 * i); }, { offsetTop: "50%" }); } animatedContents(); $(window).scroll(function () { animatedContents(); }); });