A
A
AGIFON2018-07-16 21:30:30
css
AGIFON, 2018-07-16 21:30:30

Implement Slidebar with drag and drop?

I'm a beginner front-end developer and I need help implementing what's in the picture. I have no idea how to do it. It is necessary that the slidebar has 24 hours, it has a route div, as in the picture. But most importantly, it must be dragged along the Y axis with the mouse. you can drag from one slidebar to the second, but without shifting along the X axis. How to implement this? Maybe it's already done and I can't find it. In general, help me, I've been suffering for a week now. Thank you.5b4ce37edc578214544868.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Proskurin, 2018-07-16
@Vlad_IT

I'm suffering for a week.

Drop your work. Nobody will do it for you.
What are the problems? Make the variable "drag", which is false by default. On mousedown make it true, on mouseup back false. On mousemove you do a check, if "drag" is true, then calculate the X coordinate of the mouse, and move the block to that coordinate. You can also calculate the mouse coordinate relative to the moving block, so that you can grab at any place.
For drag and drop, learn drag&drop events.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question