Тёмный

Drag & Drop with Javascript in 4 minutes 

Appwrite
Подписаться 7 тыс.
Просмотров 20 тыс.
50% 1

Learn how to build draggable elements with Javascript in a few simple steps.
Source Code: codepen.io/dennisivy/pen/VwNEPvY
Instructor: / dennisivy11 / / dennis-ivanov
💬 Follow Appwrite on social media & join our Discord community.
• Twitter: / appwrite
• Discord: appwrite.io/discord
• LinkedIn: / appwrite

Наука

Опубликовано:

 

8 апр 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 40   
@Appwrite
@Appwrite 2 месяца назад
Source code can be found here: codepen.io/dennisivy/pen/VwNEPvY
@zaanly
@zaanly 2 месяца назад
It's great to see you back on RU-vid, Dennis. Your Django tutorials were truly missed. I even tried contacting you through LinkedIn but didn't hear back. Looking forward to your new Django content! ✨
@Appwrite
@Appwrite 2 месяца назад
Hey, sorry, it's tough for me to get back to all messages. I'll take a look now and will see if I can find it. Appreciate your patience and support :) - Dennis Ivy
@artipeo816
@artipeo816 2 месяца назад
This is really under rated
@Appwrite
@Appwrite 2 месяца назад
Thank you 🙏 - Dennis Ivy
@luis96xd
@luis96xd 2 месяца назад
Excellent video, nice explanation!
@iantimmis651
@iantimmis651 2 месяца назад
This channels name and logo make it feel like its a company trying to sell me something. I thought this was going to be an ad for some JS lib.
@Appwrite
@Appwrite 2 месяца назад
Nope, just awesome tools, cool projects and a awesome Backend as a service platform if you want it. - Dennis Ivy
@garasipemula
@garasipemula 2 месяца назад
I like it, keep it up ❤
@everchanging19
@everchanging19 2 месяца назад
Love it thankyou
@SamehMustafa007
@SamehMustafa007 2 месяца назад
So nice tutorial video I like your direct explanation without a lots lablabla 👌your earn +1 subscribers
@gerryramosftw
@gerryramosftw 2 месяца назад
subscribed. this was great!
@Appwrite
@Appwrite 2 месяца назад
🙏
@user-lc7pn8zp8f
@user-lc7pn8zp8f 2 месяца назад
Thanks for video 👍 phoneview the same with touchstart events ?
@Appwrite
@Appwrite 2 месяца назад
I believe it would require a little more configuration to handle touch events. Something I'll have to take a minute and look at. - Dennis Ivy
@mrchineduOfficial
@mrchineduOfficial 2 месяца назад
This is new to me, how did you come up with all the calculations? where can I learnt this. Thank you
@Appwrite
@Appwrite 2 месяца назад
I made a quick video explaining this, see if this helps :) x.com/appwrite/status/1783310348453544198
@prateekyadav797
@prateekyadav797 2 месяца назад
How can you stop the card from going over the borders of the viewport. I used ((card.offsetTop + card.clientHeight)
@TreeLuvBurdpu
@TreeLuvBurdpu 2 месяца назад
It gets a bit more interesting when you want to allow touch-move.
@Appwrite
@Appwrite 2 месяца назад
True, a topic worth covering for sure - Dennis ivy
@alexdin1565
@alexdin1565 2 месяца назад
hi dennis we missed your django tutorials please if you have some times make videos in your channel
@Appwrite
@Appwrite 2 месяца назад
Soon, very soon Alex :) - Dennis Ivy
@AWM_2023
@AWM_2023 2 месяца назад
A bit too fast. And in 2024 we cannot refrain ourselves from excellence, so the css should be optimal, changing the cursor to draggable and dragging during the move. Thanks for the video and I hope you improve and grow a lot 💪🏼 congratulations! I’m rooting for you.
@Appwrite
@Appwrite 2 месяца назад
My assumption is that you are referring to the draggable attribute, correct? While both ways work I found that draggable has some drawbacks, but really it's just a preference at this point. Both ways work fine :) Appreciate the support 🙏 - Dennis Ivy
@walkastray007
@walkastray007 2 месяца назад
@@Appwrite Hey! I found a way to make it a little bit more "appealing" that makes it clear when it's getting dragged. in the mouseDown function you can put the following code anywhere inside. card.style.cursor = "move"; and in the mouseUp function you can put the following code inside card.style.cursor = "pointer"; When you hover over the card, it will be pointer. On mouseDown it changes it to the "move" pointer which is two bidirectional arrows (hard to explain easy to see) and on mouseUp it changes it back. Super straight forward and hope it helps!
@atl_tube
@atl_tube Месяц назад
How do you generate a new picture for dragging and dropping?
@Appwrite
@Appwrite Месяц назад
That will be shown in the full "notes app" tutorial. Currently a work in progress. - Dennis Ivy
@imagineiffcom
@imagineiffcom 2 месяца назад
I did this using jquery ui for an NBA team's contest page many years ago. Doing this with pure javascript is very interesting and gives a lot more control.
@Appwrite
@Appwrite 2 месяца назад
Yea when it’s this simple, just JS is clean. However, I’m working on the full notes app (as I mention in the beginning) and honestly, a framework like react really does come in handy when the code gets more complicated. - Dennis Ivy
@darsico
@darsico 2 месяца назад
how to keep it persistent using appwrite?
@Appwrite
@Appwrite 2 месяца назад
It's just a matter of updating the note on mouse up. The method I use is to just stringify the X & Y coordinationsa and store then in a attribute called "position". You'll see this in my upcomming video where I build out the entire notes app. Example: Save like this: JSON.stringify({x:47, y, 98}) Use like this: const position = JSON.parse(note.position) console.log(note.x) console.log(note.y)
@ashishsatavase8031
@ashishsatavase8031 2 месяца назад
how do i do this in react or next ??
@Appwrite
@Appwrite 2 месяца назад
That will be in the full tutorial ;)
@kumargupta7149
@kumargupta7149 2 месяца назад
Hi Dennis
@Appwrite
@Appwrite 2 месяца назад
Hey! 👋 - Dennis Ivy
@d.minkov
@d.minkov 2 месяца назад
You don't need those events.. there is already an event for drag in JavaScript 😂
@Appwrite
@Appwrite 2 месяца назад
You can accomplish the same thing in many different ways 😁And btw, the events you are referring to are good for drag and drop when it comes to sorting, ordering and placing items in a specific predestined position. This method gives more flexibility- Dennis Ivy
@user-of6ls2ng5l
@user-of6ls2ng5l 2 месяца назад
Thanks for the link to the code (no)
@Appwrite
@Appwrite 2 месяца назад
I’ll add that in a bit
@Appwrite
@Appwrite 2 месяца назад
codepen.io/dennisivy/pen/VwNEPvY
Далее
I Built a SECRET McDonald’s In My Room!
36:00
Просмотров 16 млн
React protected routes in 4 minutes
4:03
Просмотров 4,5 тыс.
Drag & Drop With Vanilla JS
19:00
Просмотров 251 тыс.
React Drag And Drop (dnd-kit) | Beginners Tutorial
17:27
Do this when writing database queries with Appwrite
12:09
This React Drag and Drop Component Is Magic
9:56
Просмотров 78 тыс.
Javascript Drag and Drop (11 lines of code)
6:52
Просмотров 17 тыс.
HTML Drag and Drop API
29:37
Просмотров 72 тыс.
СБОРКА ПК на RTX 4070 Super и Ryzen 5 7500F
3:37:07