Show/Hide BBcode

I hereby request a Show/Hide BBCode that hides its inner text behind a “Show”-Button. Then one can show more unuseful code/stuff without killing a page.


<div style="margin:20px; margin-top:5px;">
<div class="quotetitle">
<input class="button2 btnlite" type="button" value=" Show " style="text-align:center;width:100px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }" />
</div>
<div class="quotecontent"><div style="display: none;">
{TEXT}
</div></div>
</div>

This is my code for a phpBB forum. Maybe you can adjust it for SMF :slight_smile:

I don’t remember the reasons behind “this.innerText = ‘’;”

Well, no :slight_smile:

I will probably put a link to the pastebin functionality on JGO in the post/reply page, to accomodate extraordinary long code dumps, but most of the time the code is relevant and reducing visibility greatly reduces the number of people reading it. Reading the code is essential for providing an answer to the problem, so it will stay the way it is.

In the default SMF installation it shows about 20 lines of the code, which was deliberately changed to the current implementation.

:slight_smile:

Didn’t know about any pastebin functionality. Thanks for your explanation :slight_smile:

http://pastebin.java-gaming.org/

nice :slight_smile:

I’m sorry for posting to such an old Thread, but I would have liked such a show-hide feature for Pictures. Sometimes you have tons of pictures to show, but some people already have seen them, and it’s horrible to scroll down a page, which contains 10 pictures…