0
Creating functions
I have a code but I not sure how to make it work.
4 Answers
+ 3
Yeah, please show us your code and tell us what exactly doesn't work, otherwise it's hardly possible to help you.
+ 3
Hello Zo Nelson
You can save your code in code playground. Then post the link to the code here. Just click on the plus sign and choose insert code. Change hot today to my code bits and choose your code you want to add.
+ 3
Instead of an if statement you only need to use the not operator.
lightBoxOn = !lightBoxOn;
Means if lightBoxOn = true it changes to false (!true = false).
If it is false it changes to true (!false = true).
0
function lightboxFlipSwitch() {
// if variable switchDirection is equal to "on",
// set lightboxOn to true
// otherwise
// set lightboxOn to false
}
Here it is, I am trying to make an LED lightbox with a switch turn off and on with the code.