0

I'm trying to create an image inside a container that extends past the container, so that if I mouseover the container, the image will move opposite the direction of my mouse. If my mouse is closer to the edge of the container, the image will move faster, and if it's closer to the middle of the container, the image won't move at all.

Similar to the marked correct answer here: Move the background image on mouse over (Single Parallax) but I don't want the mouse movement to be controlling how the image moves, I want the mouse position to control how the image moves. This means that if the mouse is at the side of the image but not moving, the image will continue scrolling left until the right side of the image is at the right side of the container.

I've found similar plugins but they are intended for use as sliders and only work on the x or y axis - Sorry I tried for like half an hour to find an example again and wasn't able to :(

Does anyone know of any plugins that would be able to do this? Much appreciated!

Community
  • 1
  • 1
mcheah
  • 1,209
  • 11
  • 28

1 Answers1

0

Found a plugin that pretty much does what I need to do. https://github.com/mjfisheruk/jquery.pan

3 different modes, edge panning is the one i wanted to use. Proportional is also helpful.

mcheah
  • 1,209
  • 11
  • 28