This is a migrated thread and some comments may be shown as answers.

drag and drop cursor/pointer

2 Answers 463 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
David Ocasio asked on 21 Jan 2014, 04:48 PM
I am using the cursoroffset to position the pointer below and to the left of what is being dragged.

While this works great the cursor changes to a standard pointer is there anyway to have it change to something else(preferably cross hair) while dragging and then revert to default after drop.

thanks
dco

2 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Dyankova
Telerik team
answered on 23 Jan 2014, 02:00 PM
Hi David,

This is not supported out-of-the-box, however it can be achieved via additional code. For example:
  • Set to the draggable element cursor: crosshair style;
  • In the dragStart event change the body cursor style to crosshair;
  • In the dragend set the body cursor style to default.
    <script>
    $("#draggable").kendoDraggable({
       //....
      dragstart: function(){
         //....
         $('body').css('cursor', 'crosshair');
      },
      dragend:  function(){
         $('body').css('cursor', 'default');
      }
    });
    </script>
     
    <style>
    #draggable {
      /*....*/
      cursor: crosshair;
    </style>
          
Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 23 Jan 2014, 02:19 PM
perfect

thankyou
David Charles Ocasio
Tags
Drag and Drop
Asked by
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Iliana Dyankova
Telerik team
David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
Share this question
or