should i use a SWITCH or IF-ELSE IF-ELSE statement? or neither?
OVERVIEW/BACKGROUND
I have 2 select-lists (#list1 and #list2) each of which trigger show/hide events on divs associated with them.
I am using 2 different switch statements, one for each list + corresponding divs. This is working fine using jquery.
Please see my: Test Page a
PROBLEM
I'd like #list2 to also trigger show/hide events on some of the #list1 divs, but only if the #list1 divs are already shown.
Please see my: Test Page B
It feels like the IF/ELSEIF/ELSE statement in my Test Page B ought to work but doesnt. Which may boil down to a simple syntax issue or a larger structural/conceptual problem.
Any thoughts, comments & improvements are welcome.
It's simpler to hide them all each time, and then simply show the one you need...
it's going to be a lot more maintainable as well; try to avoid hard-coding repetition.
Bookmarks