MyBB Community Forums
Expander - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: Expander (/thread-83608.html)

Pages: 1 2


Expander - ~Rs - 2010-12-06

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.


RE: Expander - Firestryke31 - 2010-12-06

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.


RE: Expander - ~Rs - 2010-12-06

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?


RE: Expander - Firestryke31 - 2010-12-07

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


RE: Expander - ~Rs - 2010-12-08

bump!
that didn't work fawkes Sad

can matt or ajs help me?


RE: Expander - Firestryke31 - 2010-12-08

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.


RE: Expander - ~Rs - 2010-12-08

(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


RE: Expander - Firestryke31 - 2010-12-08

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).


RE: Expander - - G33K - - 2010-12-08

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.


RE: Expander - ~Rs - 2010-12-08

(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.