Skip to content

Tag: javascript

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…

Javascipt to count increment price for each tier

I am new to coding and currently touch the javascript part. I am facing a question about how to calculate the different tier prices and charges as shown in the image: Tier Pricing Table This is the code that I have tried. i represents the LOAN AMOUNT tier. When i is equal to 1 it will use the next tier

How to make modal re-render when array is updated

I’m pretty sure this is a simple issue but its stumped me. Run down: Essentially I have a list of files displayed on a table as table cells. When one is selected it becomes highlighted and is added to an array, I also can remove an item from my array by clicking again on it. Then Once I hit a