Jump to content
Search Community

Draggable map transforms on initialisation

shy_seagull test
Moderator Tag

Recommended Posts

Hi!

I am working on a map-like showcase site which the user should navigate by dragging along with the mouse. It is working as I expected it to, but before I initially click on the draggable div, it has a different scale for some reason and then transforms back to the actual size, once I first click or drag.

As shown in the codepen demo.

I’m sorry if that’s a known issue, but I couldn’t find anything in the forum yet.

See the Pen QWNNYXY by lkssmnt (@lkssmnt) on CodePen

Link to comment
Share on other sites

You need to set your .map to position relative since the divs are children of that element and absolutely positioned.

 

.map {
    width: 2500px;
    height: 1500px;
    background-color: grey;
    position: relative;
}

Happy tweening.

:)

 

  • Like 3
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...