Tim Grollman
-
Posts
8 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Tim Grollman
-
-
Hi, I'm very rusty on js, so bear with me. I am trying to turn an image ("pp") by pressing a button. I have this much, which rotates it once (in a Chrome browser): function TurnTile19() { document.getElementById("pp").style.webkitTransform="rotate(60deg)" ;} But when I press the button a second time there is no response. The relevant code in the button just says: onclick="TurnTile19()" How can I make it turn whenever I press the button? Thanks for reading. Tim
Function only runs once, but why?
in JavaScript
Posted
Many thanks justsomeguy, Once I figured out that I needed those quotes and pluses to call up the variable, it worked a treat! I was looking at your Benjamin Franklin paraphrase. I don't think you can teach yourself this stuff, you need to use other people and other resources. But you can still take pride in saying "I built my own website, I know (at least for the moment) what every line of code does, because I've cobbled it together from the ground up". Thanks again, I'm sure I'll be back for more.