Hey Campers!
I just finished the Javascript Calculator beta version. I don’t want to pass the url to the challenge map before getting some feedback and possibly fixing bugs you’ll find. I feel like I made it a bit overcomplicated with too much logical operators in if statements.
Anyway, I hope you like it
Cheers!
Sebastian
Looks nice! There a few thing though:
- After you have calculated an answer, you can always add a decimal point(also when there is already one in the answer)
- After you have calculated an answer, you can add any number to the result, but not a zero.
- The text is selectable, so clicking several times quickly on one button will select the text.
BTW: Your code is absolutely not overcomplicated. You don’t even need 100 lines of code. I am at 400 lines of code and not really finished yet…
2 Likes
Looks like “clear-entry” only works if a result is showing
Well, i saw different Clear Entry buttons. I don’t remember how it works on a real calculator, haven’t had such “equipment” for very long time. I thought it should delete the everthing that was input since last evaluation.
// I think i fixed most of the bugs you mentioned guys.
400 lines of javascript in your calculator? Would you mind sending over the url ?
The text is selectable, so clicking several times quickly on one button will select the text.
I have no idea how to fix this . Have you found a solution for that in your own project?
For making text unselectable:
body{
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: default;
}
http://stackoverflow.com/questions/2310734/how-to-make-html-text-unselectable
1 Like
Yeah, i kind of expected to see more buttons than in mine
Haha, but I still need to add the logic for most of the buttons…