As a newcomer to jQuery, I am facing a specific scenario:
I have set up the following example: http://jsfiddle.net/dVf8m/
My concern is regarding streamlining the slideToggle functionality. Currently, I am using two ids on menu elements (#trigger1
and #trigger2
) along with two ids on hidden divs (#one
and #two
). This results in redundant jQuery code. Is there a more efficient way to eliminate all the ids for a simpler implementation?
Furthermore, when clicking on both menu elements (First and Second), both divs are displayed simultaneously. Is there a method to ensure only one hidden div is visible at a time? How can I make the first div disappear when the second one appears?
Lastly, if I opt for fadeIn/fadeOut effects instead of slideToggle, how can I apply this when both involve the .click event?