No announcement yet.

collapsable tables -> default setting?

  • Filter
  • Time
  • Show
Clear All
new posts

  • collapsable tables -> default setting?


    I'm looking for a way to have a collapsable table closed by default. Is there a way to do this?

    Also, I am trying to steer the collapsing thing with two radiobuttons. So if someone clicks yes, the table uncollapses, if someone clicks no, it collapses. Suggestions and/or answers to how I would do that?


  • #2
    I think you need to modify the javascript instead of templates in order to have the collapsed by default.


    • #3
      so this is the wrong forum?
      or would you go as far as to say that this is a hack?

      I was looking for a built in option i could put in the template. something like $collapsabletable_closed, that would result in the table collapsable to to be closed by default.

      So I assume there is no such option?


      • #4
        I am not the js guru, so I can't answer for sure.


        • #5
          All you need to do is to add
          to the <tbody> element that is supposed to collapse and the vBulletin collapsing element system will deal with the rest.

          The reason you won't find any examples of this in the default templates is that if a visitor has Javascript disabled they will not be able to expand the element, and will therefore never see the hidden content.

          By having everything open by default we ensure that only people whose browsers are capable of collapsing and expanding elements have the option to do so.


          • #6
            When I do this, the default collapse/expand image is opposite when it's first viewed. In other words, normally you would want to see the button indicationg you can minimize a section, but now you would want to see the image indicating you can expand a section. But the opposite shows.
            How could I change this?
            V1 Bad Bunny Emoticons > (For Dark BGs)
            Squarehead V1 Emoticons -
            Let Users select postbit style!


            Related Topics