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

Keep Draggable in viewport

1 Answer 95 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Joseph Roberts
Top achievements
Rank 1
Joseph Roberts asked on 15 Mar 2013, 01:55 PM
I would like my draggable element to stay in view, so if I need to drag my item down the page, the page will automatically scroll until I find the place a need to drop it.  Is this possible? 

Thanks,
Joe

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 19 Mar 2013, 02:43 PM
Hello Joseph,

I am afraid that such dragging behavior is not supported. However you can try to use the events which the draggable feature provides and scroll the element according to the drag position.

http://localhost:40083/web/dragdrop/events.html

The event argument object of the drag event expose position information such as x and y fields which you can use:
e.g.
axis: "X"
client: 258
delta: -1
initialDelta: -12
location: 458
screen: 343
startLocation: 470
timeStamp: 1363703797136
velocity: -0.03125



Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Drag and Drop
Asked by
Joseph Roberts
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or