Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 7 Months, 1 Week ago [How To?] Toggle Subforums In ...
#1
Solved: 3 Years, 7 Months, 1 Week ago
I was wondering how I would get these to toggle open when clicked? Its the 'forumdisplay_subforums' area that I'm talking about.


I tried wrapping them in a toggling script but it does not work, would anyone have any ideas of what other templates I would need to edit to make this work?

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="5"><a href="#subs" onclick="toggle_visibility('subs');">{$lang->sub_forums_in}</a><br /><span class="smalltext">- click to toggle -</span></td>
</tr>
	<div id="subs" style="display: none !important;">{$forums}</div>
</table>
<br />


<script type="text/javascript">
<!--
    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
//-->
</script>


Attached Files Thumbnail(s)
   
Reply
#2
Solved: 3 Years, 7 Months, 1 Week ago
Just a friendly little bump.
Reply
#3
Solved: 3 Years, 7 Months, 1 Week ago
Try:
onClick="jQuery(this).parent().siblings('tr').eq(0).hide();jQuery(this).hide();
(unable to test do it's kind of a shot in the dark)

If that doesn't work I'll try give you a solution tomorrow it nobody else has.
Reply
#4
Solved: 3 Years, 7 Months, 1 Week ago
check if this works, incase nth's method doesn't...


<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead button" colspan="5">{$lang->sub_forums_in}<br /><span class="smalltext">- click to toggle -</span></td>
</tr>
    <table width=100% id="subs" class="subf">{$forums}</table>
</table>
<br />


<script>
$(document).ready(function(){
    $(".button").click(function(){
        $(".subf").toggle();
    });
});
</script>
We can't help everyone, but everyone can help someone - Ronald Reagan
Did you know? Your question has already been answered. But you haven't seen it yet.
Don’t  Forget to “Mark as Solved” after the fix
Reply
#5
Solved: 3 Years, 7 Months, 1 Week ago
Thank you both, mmadhankumar's option worked wonderously! Smile Much appreciated!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)