Jump to content
Search Community

Reset position of an absolute positioned div after zoom and drag

enguez test
Moderator Tag

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hello and thanks for any help you can provide guys.

Here´s my little issue:

  • I have a map
  • I need to zoom in/out this map.
  • When zoomed in, users may drag it to see the details.

 

Everything works, until I try to reset the map to it´s original scale/position. If I dragged the map, when the zoom out is selected, the scale goes right, but the position goes wrong. I want the position to be reset to the original values but it goes crazy if I made a drag of it.

 

Also, as a plus....it is possible to make this zoom in, according to the user mouse click?

 

Sorry for my grammar! :)

 

Regards!

See the Pen empmwv by enguez (@enguez) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...