You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1Accept Show/Hide Content on Wed Jun 13, 2012 10:22 am

  • L PROMEGA

    avatar

    CreativeDesignz
    Web Design and Coding
    Making Show/Hide Content
    Showing and hiding content

    This tutorial will tell you how to make show/hide a content
    <a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
    <div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

    <script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>
    Code:
    Code:
    <a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
    <div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

    <script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>



    If you want to put more show/hide content, You'll have to put the different code that colored red
    <a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
    <div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

    <script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>

    That it.

    DEMO: LINK
    Notice : This tutorial is copyrighted by CreativeDesignz. You may not publish it on anywhere without written permission from the administrators.

    View user profile
    ADMIN

    2Accept Re: Show/Hide Content on Wed Jun 13, 2012 10:26 am

  • Verrell123 ADMIN

    avatar
    Congratulations, your tutorial has been accepted.
    Thank for your contribution Very Happy

    Tutorial Accepted



    Verrell123

    Creative Designz
    Design Your Life
    View user profile http://verrell123.co.cc/

    3Accept Re: Show/Hide Content on Wed Jun 13, 2012 2:16 pm

  • Great tutorial dude!

    View user profile

    Sponsored content


    View previous topic View next topic Back to top  Message [Page 1 of 1]

    Permissions in this forum:
    You cannot reply to topics in this forum