Results 1 to 3 of 3

Thread: New Person question about SwitchContent

  1. #1
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New Person question about SwitchContent

    Switch Content
    http://dynamicdrive.com/dynamicindex...tchcontent.htm

    It works great and I love it, my only prob is that there is ALOT of empty space between each link. I have a list of titles that I want each to expand, and it works, but there is unwanted space between each title (about 20 or 30 pixels I would say).

    Is there any way to make it so there is only a line break between each title?

    Thanks!

  2. #2
    Join Date
    Jan 2005
    Location
    Seattle
    Posts
    53
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    it could be the <h3>tag. you probly could replace the tag with <span>tag.

  3. #3
    Join Date
    Jan 2005
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You can use code instead of code in step 2:

    Code:
    <span onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is JavaScript?</span>
    <br>
    <div id="sc1" class="switchcontent">
    JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
    </div>
    
    <span onClick="expandcontent(this, 'sc2')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>Difference betwen Java & JavaScript?</span>
    <br>
    <div id="sc2" class="switchcontent">
    Java is completely different from JavaScript- the former is a compiled language while the later is a scripting language.
    </div>
    
    <span onClick="expandcontent(this, 'sc3')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>What is DHTML?</span>
    <br>
    <div id="sc3" class="switchcontent">
    DHTML is the embodiment of a combination of technologies- JavaScript, CSS, and HTML. Through them a new level of interactivity is possible for the end user experience.
    </div>
    In this code "h3" tags are replaced with span as speedracer suggested. Also "br" tag is added to bring content to new line.

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
  •