Results 1 to 6 of 6

Thread: Java Script Toggle text

  1. #1
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Java Script Toggle text

    Here is the script but it only shows the text after clicking i would like to see it slide or reviel it self after clicking like on http://www.ebuddy.com/mobile.php what can i do to make that happen

    here is the script

    Java:

    <script language="javascript">
    function toggle(targetId) {
    target = document.all(targetId);
    if (target.style.display == "none"){
    target.style.display="";
    } else {
    target.style.display="none";
    }
    }
    //-->
    </script>


    html:

    <a href="javascript:toggle('Link1')">Link 1 </a>
    <div id="Link1" style="display: none">

    <div align="justify"><font color="#000000" size="2" face="Verdana">Here is the text you would like to show for Link 1.</font></div>
    </div>
    <br />
    <a href="javascript:toggle('Link2','slide')">Link 2</a>
    <div id="Link2" style="display: none">
    <div align="justify"><font color="#000000" size="2" face="Verdana">Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script Java Script </font></div>

    thanks in advance

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    not what i ment
    if you go to www.ebuddy.com and go to the mobile section and click on a question it doesnot just apear from no where it gradually slides out from undernieth the question check it out for your self

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Yes, it does do what you want it to do (with a bit of configuring)

    But anyway, here's a more easier way:

    http://www.dhtmlgoodies.com/index.ht..._content_slide
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    And also JavaScript not Java.

    And it might be better if you change your code to this:

    Code:
    <script language="javascript">
    function toggle(targetId) {
    target = document.all(targetId);
    if (target.style.display == "none"){
    target.style.display="block";
    } else {
    target.style.display="none";
    }
    }
    //-->
    </script>
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks the code at http://www.dhtmlgoodies.com/index.ht..._content_slide helped me so much with a little coding to change it i could do with it


    thanks very much

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •