• WelcomeWelcome  
  • Events  
  • PublicationsPublications  
  • FAQFAQ  
  • SearchSearch  
  • MemberlistMemberlist  
  • UsergroupsUsergroups  
  • RegisterRegister  
  • Log inLog in  
  • You are not connected. Please login or register

    Toggle content with a script

    • Administrator

        Reputation : 316
        Registered on : 2012-02-22
        Posts : 2362
        School of codes courses: coming soon
      Toggle content with a script


      You can hide/show an object/code/html part using a javascript and a html code

      Set up

      It is very simple... You have just to paste this script code in your forum:
      $(document).ready(function() {  $('.info_triger').click(function() {$('#object').slideToggle(400);return false;});});

      Or use this one if you want to have it only in a page:
      <script type="text/javascript">$(document).ready(function() {  $('.info_triger').click(function() {$('#object').slideToggle(400);return false;});});</script>

      Then use this html code (and edit it) for the lick/text that will open the "object":
      a href="LINK" class="info_triger">Text

      And this one for the hidden message:
      <div id="object" style="display: none;">Content</div>

      And it's done :bene:

      Customize the tutorial

      You can change the messages and the links :birra:

      Technical problems

      The tutorial was tested on this forum and with the browser Google Chrome; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your reporting.

      Thanks, the staff

      For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...

      The team of the Forum of Codes.

      Niko wants you in the team Guest

      Community manager and Administrator at Forumattivo.com

      • Manager

          Reputation : 20
          Registered on : 2012-04-01
          Posts : 407
        Nice tutorial, this should come in handy.

        DMCA.com Protection Status
        © PunBB | Contact | Report an abuse