I have some buttons that move an image with translation, but when I press one button then another and then the first one again, it jumps to where I was the the last time I pressed the first button. Here is the JavaScript responsible for moving the image. Answer basically creating two objects inside a JSON var…
Tag: html
Input tag validation
I have just an input tag with the following logic: https://codepen.io/ion-ciorba/pen/MWVWpmR I have a minimum value coming from the database(400 in this case), the logic is good but the user interaction with the component is really bad, the user can’t input a value that is below 400, I want something el…
Open one accordion section at a time. (Svelte)
I’d like to ask someone who can figure out how to allow this accordion component to open only one section at a time. It means that if a new accordion is open the previous one has to close automatically. In the ideal situation, this function could be optional for specific accordions. Thank you for your t…
Javascript Improve collapsing element
I have created this toggle script which works well but I need to improve it so that onclick, any previously collapsed (i.e. open) subcats would simultaneously close and only the one clicked should collapse (i.e. open). Answer First, loop through the open elements and remove the class and set max height to nul…
Make table which have cells 10×10 and every cells have inside number from 1 to 100
Need to make table which have numbers from 1 to 100, and it should be 10×10 cells. I make cells 10×10 but result fill every grid line from 1 to 10, how to make every line like that 1 to 10, 11 to 20 and to 100 like that ? Thank you for attention to my problem. Answer
How to switch from graph view and tableview with a toggle button in Ionic 6/Angular?
I have two components to show data. The table view and the graph view. Both components has the same data. I use a toggle switch button to switch between these views. This is my code: The default view is the graphview via chart.js. Both components works fine. This is my code to hide and show: When I click on t…
How to make the span to fill empty space on current line and continue to show remaining text on next line
In the below code snippet example, after marked word science and theory there is a empty space at the end. Forcing the next span element to appear on the newline. How to make the next span element after marked word to fill the empty space. and then the remaining words of that span should continue display on n…
How to use document.write() with a file instead of just text?
I am using socket.io to create a party game similar to cards against humanity. I am just wondering how I can keep the players name and score etc without having to send all the data to a new page when new games begin. I was thinking to just change the body of the html but stay on the same page
CSS – Issues animating child on parent hover?
I have looked at Move HTML element upwards on hover and I know how to define the CSS animation I want, however given the other animations at play in this snippet I am running into issues animating a child element on parent hover. Snippet: This is the animation I want to apply to only the text of the nav bar
element is position absolute but must still relative in parentDiv to make it like slider
So my problem here is that I want to make a slider in parentDiv but I make a simple example which is when I click the item it will become the main screen of the screen border…but in opposite when I click it over again it will turn back.. I’m using gsap but you don’t have to worried about the