Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Comment List Collapse

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #45123
    sabas
    Member

    Hi guys.
    Hopefully you could help me with this one.
    I have a comment thread that if someone goes and comments on it, they will get the first reply visible but after that I will need something that wraps the .depth-2 comments that are not from an admin and be able to collapse them by clicking on More Comments link.
    I have started with this


    $('.commentlist .depth-2:not(.byuser)').wrap('
    ');
    $('.collapse-comments').prepend('

    More Comments

    ');
    $('.collapse-comments .depth-2').wrap('
    ');
    $(".collapse-comments").collapse();

    but the problem is I get a More Comments link per each comment and my objective is wrapping the all div having in mind that i have multiple classes with the same name.

    First Comment by guest (visible)

    Second Comment By Admin (visible)

    First Hidden Comment

    Second Hidden Comment

    thks guys

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.