The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to make collapse closed by default?
Hi
I have this bit of code, It has a collapse feature and i would like to know how to set the code so that the box is closed by default please? Code:
$nzbfiletable = "<table class=\"tborder\" cellpadding=\"$cellpadding\" cellspacing=\"$cellspacing\" border=\"0\" width=\"100%\" align=\"center\"><td class=\"tcat\" colspan=\"2\"><a style=\"float: right;\" href=\"#top\" onclick=\"return toggle_collapse('nzbfile" . $nzbfileid . "');\"><img id=\"collapseimg_nzbfile" . $nzbfileid . "\" src=\"" . $imgdir_button . "/collapse_tcat.gif\" alt=\"\" border=\"0\"></a>NZB File Contents</td></table>"; $nzbfiletable .= "<table cellspace=\"1\" style=\"\" id=\"collapseobj_nzbfile" . $nzbfileid . "\"><tr bgcolor=\"#B9CAE6\"><td><font face=\"Verdana\" size=\"1\">Subject</td><td><font face=\"Verdana\" size=\"1\">Group</td><td><font face=\"Verdana\" size=\"1\">Size (kb)</td><td><font face=\"Verdana\" size=\"1\">Parts</td><td><font face=\"Verdana\" size=\"1\">Poster</td></tr>"; |
#2
|
|||
|
|||
I'm also looking for a way to do this
I've seen this, https://vborg.vbsupport.ru/showthrea...sed+on+default but people without javascript cant reopen the box. Or you could use this code after the box is created within the template that holds the box. Code:
<script type="text/javascript">toggle_collapse('IdOfBoxToCollapse')</script> We need a close('IDOfBoxToCollapse') |
#3
|
||||
|
||||
no you just need some code in a template...
Here is one I use, it opens and closes when you click the arrow icon.. Replace all occurances of VARIABLE with whatever variable you choose to name it. I dont know PHP all too well, so I dont know how you would work this into PHP but im sure you could figure something out. you can see basically there is a a collapsable table, and the tbody which contains the information to be collapsed. the rest is just a simple table template basically.... using another "bits" template for the content. Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"> <thead> <tr> <td class="tcat" colspan="5" align="left" width="100%"> <a style="float:$stylevar[left]" href="#top" onclick="return toggle_collapse('VARIABLE')">Main Header</a> <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('VARIABLE')"><img id="collapseimg_VARIABLE" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_VARIABLE].gif" alt="" border="0" /></a> </td> </tr> </thead> <tbody id="collapseobj_VARIABLE" style="$vbcollapse[collapseobj_VARIABLE]"> <td class="thead" width="2%" align="left"></td> <td class="thead" width="11%" align="left"><b>Title 1</b></td> <td class="thead" width="49%" align="left"><b>Title 2</b></td> <td class="thead" width="18%" align="left"><b>Title 3</b></td> <td class="thead" width="26%" align="left"><b>Title 4</b></td> $tablebits </tbody> </table> <div class="spacer"></div> <br /> |
#4
|
|||
|
|||
What i am after is having the box closed for default, any ideas, i already have the box and collapse objects
|
#5
|
||||
|
||||
In your template have it show the collapsed image by default, and also have the box with the following style applied:
Code:
display: none |
#6
|
|||
|
|||
Hi SirAdrian. The code that i have is in the 1st post, can you please advise where it would go in that code please?
|
#7
|
||||
|
||||
|
#8
|
|||
|
|||
Cheers dismounted
|
#9
|
|||
|
|||
Thanks for collapsed style code
I added display:none style in my object. all rows are now collapsed by default. Is there a way that we can set first row to be expanded and all others to be collapsed. then user can click on collapsed one's to expand. Can we set that option in same box, to first row to be expanded and all others to be collapsed when page loads. Appreciate any help Thanks |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|