MyBB Community Forums

Full Version: Show/Hide Signature - a simple modification..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This simple modification has been made for this query : [How to] hide signatures ...

[Image: sighide.png]

it uses jQuery as most of modern themes include it for fancy collapse & expansion effects

first check if jQuery script is included with the theme
most probably it will be in HeaderInclude template.

jQuery code will be similar to below code
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>

if above code is not included in HeaderInclude template & if you are sure
that jQuery is not used then add above code after any </script> line

now browse to current template set's postbit_signature template

find code similar to below :
<hr size="1" width="25%"  align="left" />
{$post['signature']}

replace above with :
<hr size="1" width="25%"  align="left" />
   
    <dl class="signature">
       <dt>
          <a onclick="jQuery(this).parents('.signature').find('.sig-content').toggle('slow'); return false;" href="#">Show/Hide Signature</a>
       </dt>
       <dd>
          <div class="sig-content" style="display: none;border-bottom: 1px solid rgb(204, 204, 204);">{$post['signature']}</div>
          <noscript>
             please enable javascript..
           </noscript>
       </dd>
</dl>

that's it .. comments and bug reports are awaited Smile

Thanks to faviouz
Nice modification ranjani
Good Work