1

Drag the content from the one component list and drop the content into another component and content will not be dropped into particular position. Drag the div any drop any certain position on the page. I have found solution in jquery 1.9.1

<div class="dragger">Drag</div>
<div class="dragger">Drag</div>
<div class="dragger">Drag</div>
<div class="dragger">Drag</div>
<div class="dragger">Drag</div>
<div class="dropper">
    <p>Drop</p>
</div>

jquery 1.9.1+javascript

  $(document).ready(function () {
        $('.dragger').draggable({
            revert: "invalid",
            helper: function () {
                //Code here
                return $("<div class='dragger'></div>").append("Hi");
            }
        });


        $(".dropper").droppable({
            drop: function (event, ui) {

                $(this)
                    .addClass("ui-state-highlight")
                    .find("p")
                    .html("Dropped!");

                var element = $('.ui-draggable-dragging');
                var currentDrop=$(this);
                return element.clone().appendTo(currentDrop);
            }
        });
    });

but when I will implement that code in latest jquery version then it will show ERROR TypeError: $(...).draggable is not a function

how to implement that code in angular 8

Nikita Garg
  • 157
  • 1
  • 2
  • 11
  • Please include a [Minimal, Complete, and Verifiable example (MCVE)](https://stackoverflow.com/help/mcve) that demonstrates your problem in your post and **don't just include a link to Fiddle**. Links rot, and your post should stand alone from any other resource; this question will lose any value to future visitors if jsFiddle is blocked or goes away in the future! – 4b0 Jun 26 '19 at 03:59
  • In addition to what @Shree pointed out, having your code in a link instead of in the post potentially makes it more difficult for people to find your post in Google, which diminishes the usefulness of the post to future readers since fewer people will be able to read and potentially benefit from it. – EJoshuaS - Stand with Ukraine Jun 26 '19 at 04:11
  • I have edited my question so don't put my question on HOLD. please help me to solve this problem. – Nikita Garg Jun 26 '19 at 04:43
  • See https://stackoverflow.com/a/28207155/965146 – 4b0 Jun 26 '19 at 05:16
  • Thanks, but not worked for me if any drag and drop package do you know that works like a https://www.wix.com/ website – Nikita Garg Jun 26 '19 at 05:55

0 Answers0