Little problem in js. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Little problem in js.

Why is the door not opening on first click? https://code.sololearn.com/WQ0lUGCK1aSC/?ref=app

22nd Sep 2019, 5:44 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
5 Answers
+ 3
CSS properties aren't famous for being readable that well. But switching the if cases can work https://code.sololearn.com/W0VvC3Ultg0F/?ref=app
22nd Sep 2019, 6:08 PM
Airree
Airree - avatar
+ 4
Anton Böhler but on css I added transform:rotateY(0deg)
22nd Sep 2019, 6:07 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 4
It worked. Thank you Airree ! 😁 Anton Böhler thank you for your solutions. 😊
22nd Sep 2019, 6:10 PM
🍇 Alex Tușinean 💜
🍇 Alex Tușinean 💜 - avatar
+ 1
window.onload = function(){ $("#door-face").style.transform = "rotateY(0deg)"; } add this 😁
22nd Sep 2019, 6:02 PM
Anton Böhler
Anton Böhler - avatar
+ 1
well when i added it it worked first try 🤷‍♂️
22nd Sep 2019, 6:08 PM
Anton Böhler
Anton Böhler - avatar