How do you make text selectable on a jQuery draggable div?

前端 未结 2 1362
無奈伤痛
無奈伤痛 2020-12-29 20:23

I made a div draggable using jQuery. However, there is some text in that box, and I would still like to be able to copy and paste the text, but when I make an item draggable

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 21:23

    Use the cancel option when making the element draggable.

    Prevents dragging from starting on specified elements.

    $('.selector').draggable({ cancel: '.text' }); 
    

提交回复
热议问题