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


    Toggle content with a script

    avatar
    • Administrator

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

      Description


      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:
      Code:
      $(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:
      Code:
      <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":
      Code:
      a href="LINK" class="info_triger">Text


      And this one for the hidden message:
      Code:
      <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...


      Friendly,
      The team of the Forum of Codes.



      Niko wants you in the team Guest

      Community manager and Administrator at Forumattivo.com

      avatar
      • Manager

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




        YOUR BANNER HERE
        728x90
        DMCA.com Protection Status
        Free forum | © PunBB | Free forum support | Contact | Report an abuse | Free forum