$(window).scroll(function(){ var w = $(window).scrollTop(); var e = "translateX(" + w*-0.01 + "px)"; var f = "translateY(" + w*0.01 + "px)"; $('.effetimg').css({ transform : e }); $('.effetimg1').css({ transform : e }); $('.thm-logo-box').css({ transform: f }) });