how to make background image move mmousemove jquery

Solutions on MaxInterview for how to make background image move mmousemove jquery by the best coders in the world

showing results for - "how to make background image move mmousemove jquery"
Sophia
25 Feb 2017
1how to make background image move mmousemove with jquery:
2$('background-section').mousemove(function (e) {
3  // values: e.clientX, e.clientY, e.pageX, e.pageY
4  // console.log(moveX = (e.pageX));
5  let moveX = (e.pageX * -1 / 20);
6  let moveY = (e.pageY * -1 / 15);
7  $(this).css('background-position', moveX + 'px ' + moveY + 'px');
8});