1 Reply Latest reply on Dec 16, 2014 1:46 AM by julkjen

    jquery draggable in a rotated container

    julkjen Level 1

      I'm trying to create a waterpipe with a draggable valve. The waterpipe is rotated at 25 degrees, and I want to limit the draggable valves movements inside the pipe....

       

      Is this even possible?

        • 1. Re: jquery draggable in a rotated container
          julkjen Level 1

          I solved this by making an invisible copy of the valve, that is draggable inside a container around the pipes length, that is only draggable on the x axis.

          Then as the draggable valve is dragged, the original valve is repositioned on both the x axis (same position as copy) and y axis (caluclated acording to angle), and once the valve copy is dropped it is repositioned to be on top of the original valve.

           

          a bit of work to get it together, but it looks like you can drag the valve diagonally inside the rotated pipe