you, sir, have just made my day. thank you a million!

> Maybe you have an answer already, but I didn't see one on the list.  
> You can make the code simpler.  Something like this.
>
> $(document).ready(function() {
>
> $('.commenting').hide();
>
> $('a.show_com').click(function() {
>    if ( this.className == "show_com" ) {
>      $(".commenting").slideDown('slow');
>      $(this).removeClass("show_com").addClass("hide_com").text("HIDE  
> COMMENTS");
>    } else {
>      $(".commenting").slideUp('fast');
>      $(this).removeClass("hide_com").addClass("show_com").text("SHOW  
> COMMENTS");
>    }
>    return false;
>
> });
> });
>
> If you want a plus or minus you can either do it in test
>      $(this).removeClass("show_com").addClass("hide_com").text("-");
> or you can add a background image in css
>
> a.show_com, a.hide_com {
>    width: 16px;
>    height: 16px;
>
> }
>
> a.show_com {
>    background-image: plus.gif;}
>
> a.hide_com {
>    background-image: minus.gif;
>
> }
>
> The code could be even simpler if you use one class.
>
> $('a.show_com').click(function() {
>    $(this).toggleClass("show_com");
>    $(".commenting").slideToggle("slow");
>    return false;
>
> });
>
> then the css would be
>
> a {
>    width: 16px;
>    height: 16px;
>    background-image: minus.gif;
>
> }
>
> a.show_com {
>    background-image: plus.gif;
>
> }
>
> --
> Roger Roelofs

Reply via email to