This is the code I use to hide and show a div with a slide switch effect.
jQuery(document).ready(function() { jQuery(".option-content").hide(); jQuery(".option-heading").click(function() { jQuery(this).next(".option-content").slideToggle(500); }); });
However, I would like to add a few switched arrows to show that the div is overloaded up or down.
This is what I still have, and it does half what I would like to do:
jQuery(document).ready(function() { jQuery(".option-content").hide(); jQuery("#arrow-up").hide(); jQuery(".option-heading").click(function() { jQuery(this).next(".option-content").slideToggle(500); jQuery("#arrow-up").toggle(); jQuery("#arrow-down").toggle(); }); });
This switches the arrow, but there are two problems:
- Down arrow shown
- Each div toggles each arrow, so when some divs are up and one is down, they all appear as down.
Any ideas would be appriciated
David passmore
source share