You have this code here:
But I don't see any check for the other way around? To do the opposite you need to be checking for when the max slider is less than the min slider and adjust the max slider to equal the min slider in that case. Try adding this code.
// Prevent the maxSlider from beingl less than the minSlider's value
if (maxL < minL) {
maxSlider.value = minL;
maxL = minL;
}
I'm pretty sure your problem is because the minSlider can't be more than the max slider so if the max slider goes under the min slider than the min slider is moving to the left to be less than it.
Edit: Maybe it has to be one statement like this:
// Prevent the minSlider from exceeding maxSlider's value
if (minL > maxL) {
minSlider.value = maxL;
minL = maxL;
} else if (maxL > minL) {
maxSlider.value = minL;
maxL = minL;
}