Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamSwayne committed Mar 4, 2024
1 parent 4c84dee commit dce53e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions site/calculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ <h2>Results</h2>
treeSlider.appendChild(slider);
treeSlider.appendChild(output);
treeSlidersContainer.appendChild(treeSlider);

// Add event listener for each tree slider
slider.addEventListener('input', function () {
updateTreeQuantity(treeId, `${treeId}Output`);
});
}
}

Expand Down Expand Up @@ -200,8 +205,8 @@ <h2>Results</h2>

// Event listener for number of trees input
document.getElementById('numberOfTreesInput').addEventListener('input', function () {
const numberOfTreesInputValue = parseFloat(this.value) || 0;
createTreeSliders(numberOfTreesInputValue);
numTrees = parseFloat(this.value) || 0;
createTreeSliders(numTrees);
});

// Function to update tree quantity based on budget
Expand Down

0 comments on commit dce53e4

Please sign in to comment.