Skip to content

Tag: css

Modal not opening after closing previous one with setTimeout

I have a modal that will open with a fading animation (opacity 0 to 1) and will close with the same animation (opacity 1 to 0). Everything is working except for the closing animation. I have a “fade” class and use JS in order to change the “animationName” depending if the user closes/o…

How can I save checkbox state to my database?

I’m trying to create a Todo-list app using (nodejs,ejs…) so for every todo I create a checkbox. If someone finishes his job and uses the button bin recycle to delete it, I save that using MongoDB but I’ve a problem when checking. When I reload the page this checked box disappears. In other w…

Create a +1 Animation when button is clicked

I was making a game where you get money for clicking on a button. Here’s a part of it: Later i was looking in the Internet and i found a website called Cookie Clicker and i saw this animation that when you click the cookie, a +1 is going up and fades away (It is not so important that the

Trying to position JavaScript variables

I’m just learning javascript and I’m trying to center the theDate var by using the style tag but it stays to the far left anyone see where I’m going wrong? Answer your css is centering the element with the id theDate, so wrap that string in a with that id document.write(‘<div id=&#8…

How to handle event element in container?

I want to click btnToggle, Navigation will run but I don’t know why this code sometimes is successful, sometimes is unsuccessful. Help me please, thanks all Answer You’re pretty close. Because you attached the event listener to document, your callback function will actually run if you click anywhe…

querySelectorAll selects all similar classes

Calendar is using 3 different classes to style its child elements: “old day”, “day”, “new day”. Trying to querySelectorAll element with class name “day” also captures the other two classes, so when i say something like: I will get click on old 28th instead of cu…