Jump to content
GreenSock

Stefdv

Draggable cloning option?

Recommended Posts

I want to drag a 'marker' to a (world)map, but since the user should be able to place multiple markers i need to leave the original in place.

 

The idea is :

 

- user clicks(mousedown) on marker icon

- create a clone an attach it to the cursor 

- on mouseup place the marker on the map.

- user places second marker, etc etc.

 

 

Link to comment
Share on other sites

Forums SuperStart Rodrigo has already built exactly what you need:

http://codepen.io/rhernando/pen/Jlfsq?editors=001 (drag the grey square element0)

 

 

I believe the general idea is that you will always have one transparent draggable marker sitting over your static visible marker.

When you start dragging the static marker, the draggable one gets its opacity increased.

Also when you start dragging a new transparent draggable gets created and sits on top of the static visible marker.

 

This is a very clever approach.

  • Like 3
Link to comment
Share on other sites

great, missed that one ;) A clever approach indeed. Tx...problem solved.

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.
×