The first script is a show/hide when pressing a Expand all and collapse all button:
- $(".hide").click(function(){
- $(".screentitle").hide();
- });
- $(".show").click(function(){
- $(".screentitle").show();
- });
- The second code I use is the image swap for slideToggle:
- $(".chaptertitle").live("click", function(){
- $(".screentitle", this).slideToggle("fast");
- var $img = $(".img-swap", this);
- if ($img.attr('src').indexOf("plus.png") > -1) {
- $img.attr('src', $img.attr('src').replace('plus', 'minus'));
- return false;
- } else {
- $img.attr('src', $img.attr('src').replace('minus', 'plus'));