PDA

View Full Version : New Person question about SwitchContent



danakalinin
01-12-2005, 12:21 AM
Switch Content
http://dynamicdrive.com/dynamicindex17/switchcontent.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!

speedracer
01-12-2005, 01:21 AM
it could be the <h3>tag. you probly could replace the tag with <span>tag.

FPit
01-12-2005, 09:55 AM
You can use code instead of code in step 2:


<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.