+ 1

I have created a object and in the html I am trying to get it to move(up, down..)using buttons.Can you check to see whats wrong?

<button onclick='MoveObject'("left 20px")>Left</button>

6th Jan 2017, 11:14 PM
Rain Tawia
Rain Tawia - avatar
4 Réponses
+ 2
MoveObject being undefined: You need to create the function named this. I imagine you are changing the CSS/style of the element. It's easier to do this using jQuery.
7th Jan 2017, 2:06 AM
Louis Milotte
Louis Milotte - avatar
+ 1
What's the code for MoveObject look like?
6th Jan 2017, 11:32 PM
James Durand
James Durand - avatar
0
I properly don't have a code. That must be whats wrong because the error says MoveObject is not defined. Thanks I'll read up on it.
7th Jan 2017, 12:05 AM
Rain Tawia
Rain Tawia - avatar
- 1
You must be make a code in your css file
7th Jan 2017, 10:58 AM
Finnlukas