How can I style jQuery draggable clone?

前端 未结 3 800
心在旅途
心在旅途 2020-12-15 16:22

How can I style jQuery draggable clone with CSS?

3条回答
  •  情书的邮戳
    2020-12-15 16:31

    There's a better way

    jQuery UI has evolved since the answer was posted in 2011.

    With current versions of jQuery, the .ui-draggable-dragging class is added to the clone being dragged.

    So for example, if you have the following draggable element:

    ..then the myDraggable element clone will have a red background when it is picked up and dragged.

    The helper class is present in jQuery UI 1.7.1 onwards, and it may also be present in some earlier versions but I haven't tracked that down.

提交回复
热议问题