So, I've just recently become enlightened by jQuery and would like to add it to my site, but I'm having a little trouble. I made this basic function:
- function showPanel(id) {
- var panel = $(".further_info." + id + "");
- panel.slideToggle();
- $(this).toggleClass("minus");
- $(this).toggleClass("plus");
- }
To give an example of its use:
- <a class="panel_control plus" onclick="showPanel(0);"></a> <div class="further_info 0">blah blah blah</div>
The panel is displayed correctly, but the classname of the link isn't toggled between "plus" and "minus." Any insight as to what I'm doing incorrectly? Thanks!