Jump to content
Search Community

Draggable cloning option?

Stefdv test
Moderator Tag

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

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

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