How to Move an Object with Arrow Keys in Javascript

preview_player
Показать описание
In this video, you will learn how to move an object with arrow keys in javascript. I hope you'll like the video and leave your feedback and suggestions for future video tutorials.

0:00 Intro
0:15 HTML
0:38 CSS
1:11 Javascript
4:13 Final Output
Рекомендации по теме
Комментарии
Автор

any way to make it work when it's a nested class? I have a game class (just a border) and i have a class 'square' inside it, but it just doesnt show up on the web page

noakemp
Автор

Thank you for your video! I am wondering, how would the script change if we wanted to make the moving object a small uploaded image?

celestecastillo
Автор

This video is Epic Very easy to understand it best video

GamingGeek
Автор

For some reason my object isn't moving on ArrowUp and ArrowLeft. Anyone else faced the same issue?

pranshutriestovlog
Автор

0:30 how do you make that line in the side to come? i have trying to figure it out for 2hrs now. can someone tell me that? and even what its called

ark-s
Автор

how would you do this with jquery :c i dont know how to dumb it down i know its still javaScript but nothing really works, also i need it to work when you hold down the key :/

FelipeNiclvs.
Автор

How to change the starting position of the circle ?

Danny-ffkb
Автор

can you do a tutorial where it moves in a diagonal like pressing up and left at the same time??

chessjames
Автор

Thank you so much but how can i make the circle object move countinusely ?

ifaisalne
Автор

I'm not getting the circle to move up, any idea what can be wrong? Everything else works perfectly

johannahoff
Автор

is it possible to move diffrent objects with same arrow keys but not at the same time? If yes, can u explain how?

hamzasadioglu
Автор

Is there any way to limit the movement inside a div?

KurumiZph
Автор

Sorry, thank you my friend do you know Mohamad?

AlexLXIX
Автор

Thanks, but i have a problem : when my object goes down, my page goes down too. On the other hand, when I go up, the page goes up but not my subject. Do you know how to do it? thank you

bipblyp
Автор

Could you please explain, why was it neccesary to parseInt(circle.style.left)
even though it is already an integer, because initally we set its value to 0 which is an integer and not a string . Please, explain.

prasannasagarregmi
Автор

I use android so could you do show use accesskey for arrow keys.

WebGamek
Автор

Can you please give me code to move a div element by buttons like:- up, left, right, down. Please help brother. please 🙏🙏

vinteeggamer
Автор

Who else goes to comments during ad breaks?

CodeToad_
Автор

is there a way to stop page scrolling..?

MrZanProductions
Автор

put the full code in the description, i did exactly what u said and it doesnt work

woomygfx
join shbcf.ru