Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

use drag and drop

   <DragDropContext onDragEnd={handleOnEnd}>
        <Droppable droppableId="droppable-1">
          {(provided, _snapshot) => (
            <div ref={provided.innerRef}>
              {faqList.map((faq, idx) => {
                return (
                  <Draggable
                    draggableId={String(faq.id)}
                    key={faq.id}
                    index={idx}>
                    {(provided, _snapshot) => (
                      <div
                        ref={provided.innerRef}
                        {...provided.draggableProps}
                        {...provided.dragHandleProps}>
                          {/* YOUR_CONTENT_HERE */}
                      </div>
                    )}
                  </Draggable>
                );
              })}
              {provided.placeholder}
            </div>
          )}
        </Droppable>
      </DragDropContext>
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #drag #drop
ADD COMMENT
Topic
Name
9+6 =