MyBB Community Forums

Full Version: Expander
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'll make it simple this time because apparently i made it too confusing last time.

I'm using the BlackEvo4 theme.
How do i code an expander for custom boxes? With the code i'm using the expander shows up, but it does not minimize the boxes.
Try this:
<td class="thead">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['/* Your_ID */']}.gif" id="/* Your_ID_img */" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>/* Your title */</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['/* Your_ID_e */']}" id="/* Your_ID_e */">
//Your stuff here
</tbody>

Note that the _img and _e after Your_ID are important.

Sorry for page stretch.
thank you, i'll try it when i have time and let you know if it works Smile
it didn't work Sad

wait, what am i supposed to put in the "Your_ID" area?
Whatever you want, just make sure it's the same for all three parts, but different for each box you want to collapse. Also I'm pretty sure the image needs the "expander" class for the JS to work.

This would also probably be a bad time to say I'm just guessing and haven't been able to test this myself... Sad
bump!
that didn't work fawkes Sad

can matt or ajs help me?
Sorry, I thought doing it the same way MyBB did would work. Sad Maybe I'm missing something...

BTW, my name's not Fawkes, it's an online pseudonym when I can't use my normal tag.
(2010-12-08, 07:03 PM)Firestryke31 Wrote: [ -> ]Sorry, I thought doing it the same way MyBB did would work. Sad Maybe I'm missing something...

BTW, my name's not Fawkes, it's an online pseudonym when I can't use my normal tag.

my bad firestryke, i wasn't aware Sad
Don't feel bad, you're not the first person to get it wrong and you won't be the last, especially since I provide no evidence that my name isn't Fawkes (or Richard Fawkes for the full pseudonym).
Assuming you're using templates:

The image:
<img src="{$theme['imgdir']}/{$expcolimage}" id="UNIQUEID_img" class="expander" alt="" title="" />

The div/table to hide/show:
<div id="UNIQUEID_e">

Notes:
- The image must have the expander class
- UNIQUEID must be completely unique and not used elsewhere on the page
- $expcolimage must be defined in your code based on whether its collapsed or expanded, otherwise it will not work or will show incorrect image for the collapse/expand. If you can't do that then just use collapse.gif but keep in mind that the image might become incorrect if page is refreshed.
(2010-12-08, 11:05 PM)- G33K - Wrote: [ -> ]Assuming you're using templates:

The image:
<img src="{$theme['imgdir']}/{$expcolimage}" id="UNIQUEID_img" class="expander" alt="" title="" />

The div/table to hide/show:
<div id="UNIQUEID_e">

Notes:
- The image must have the expander class
- UNIQUEID must be completely unique and not used elsewhere on the page
- $expcolimage must be defined in your code based on whether its collapsed or expanded, otherwise it will not work or will show incorrect image for the collapse/expand. If you can't do that then just use collapse.gif but keep in mind that the image might become incorrect if page is refreshed.

thank you! <3

i'll test it out this weekend.
Pages: 1 2