The particular problem I'm having is when it comes to rounding the loading bar width after the calculation.
The current code takes the hourly value associated with each button and creates a percentage that dictates the loading bar's length. However there is a rounding error associated with the calculation that causes the loading bar to not always match the length exactly.
Here are the most important snippets of code:
This section of code is responsible for getting the hourly value from the "add to itinerary" button.
The set duration function which sets the loading bar's length.
I tried performing this calculation without any rounding and got loading bar errors. I've tried rounding the result to the nearest integer and the nearest multiple of 5. I still get issues, particularly when the loading bar is being shortened, which is the exact same calculation just inverted.
Some other issues:
1. On the live website, the hover effect and clickability don't register on all of the buttons. I've tried inspect element and can't see any different between the buttons that work and dont.
2. If I press one itinerary button quickly, I'm able to bypass the maximum allowable hours. For example, if the max itinerary is 10 hours, if I click the button very quickly I can have activities totalling over ten hours. I don't understand why the pace of the clicks matters when it should be going through the if else loop every time.