$(document).ready(function () { $('.a-process').on('click',moveBar); $('.update-to-perm').on('click',upadateFrame); }) function moveBar() { var distanse=21+($(this).index()-1)*91; $('.point-bar').css({'top':distanse.toString()+'px','visibility':'visible'}); } function scrollAds() { var scrolling=document.getElementsByClassName('scroll-ads-imgs').item(0); if(scrolling==null) { clearInterval(start_scoll); } else { if(scrolling.style.transform=="translateX(0%)") { $('.scroll-ads-imgs').css('transition','0.4s'); scrolling.style.transform='translateX(-100%)'; } else if(scrolling.style.transform=="translateX(-100%)") { scrolling.style.transform='translateX(-200%)'; } else if(scrolling.style.transform=="translateX(-200%)") { scrolling.style.transform='translateX(-300%)'; } else if(scrolling.style.transform=="translateX(-300%)") { $('.scroll-ads-imgs').css('transition','none'); scrolling.style.transform='translateX(0%)'; window.setTimeout('scrollAds()',200); } } } var start_scoll=window.setInterval('scrollAds()',3000);