anton zamov it expert logo   best php scripts for your website

home page latest news web development curriculum vitae scripts contact me

  • C# (Microsoft .NET)
  • JAVA
  • Dynamic HTML
  • PHP & MySQL
  • ASP.NET - C# & VB.NET
  • Perl & CGI
  • C | C++
  • Vector Markup Language
  • SMIL
  • Assembler
  • Databases
  • Wap Development
  • Web site promotion
  • Web Marketing



How to create a DHTML expandable list (works only in Internet Explorer)?

(DHTML free example written by Anton Zamov.)


How to create a DHTML expandable list (works only in Internet Explorer)?

Try the following example:

<html>
<!-- Creation date: 3/14/2003 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">

<style>
.general {font-family:Verdana;font-size:11;color:white}
.span_general {font-family:Verdana;font-size:9;color:white;border-style:solid;border-color:white;border-width:1px 1px 1px 1px;text-align:center;width:16;height:15;cursor:hand}
</style>

<script>

function objectOver(x){
x.style.color="#9ff5ff";
}

function objectOut(x){
x.style.color="white";
}

function collapse(x){
var oTemp=eval("document.all.text_"+x);
var oClick=eval("document.all.click_"+x);

      if(oTemp.style.display=="block"){
            oTemp.style.display="none";
            oClick.innerHTML="+";
      }
      else{
            oTemp.style.display="block";
            oClick.innerHTML="-";
      }
}
</script>

</head>
<body bgcolor=#224452>

<div id=click_1 class=span_general onclick=javascript:collapse('1') onmouseover=javascript:objectOver(this) onmouseout=javascript:objectOut(this) style="margin-left:100;position:relative;left:-25;top:14" > - </div>

<div style="margin-left:100;display:block" class=general>
Text 1 TITLE bla bla
</div><br>
<div id=text_1 style="margin-left:100" class=general>
teddfg ejwrhtwjkerhtjwekrhtwjlerht bn sadfbasdnfb asdfnbm asdfnb<br>
sadfasdf wert ewrtrty rety yturtu<br>
asfsdfsda rtuytyurtyu jghmkjmglkhjmkghm gfhj ghj
</div>

<div id=click_1_1 class=span_general onclick=javascript:collapse('1_1') onmouseover=javascript:objectOver(this) onmouseout=javascript:objectOut(this) style="margin-left:200;position:relative;left:-25;top:14" > - </div>
<div style="margin-left:200;display:block" class=general>
Text 1_1 TITLE bla bla
</div><br>
<div id=text_1_1 style="margin-left:200" class=general>
teddfg ejwrhtwjkerhtjwekrhtwjlerht bn sadfbasdnfb asdfnbm asdfnb<br>
sadfasdf wert ewrtrty rety yturtu<br>
asfsdfsda rtuytyurtyu jghmkjmglkhjmkghm gfhj ghj
</div>


<div id=click_1_2 class=span_general onclick=javascript:collapse('1_2') onmouseover=javascript:objectOver(this) onmouseout=javascript:objectOut(this) style="margin-left:200;position:relative;left:-25;top:14" > - </div>
<div style="margin-left:200;display:block" class=general>
Text 1_2 TITLE bla bla
</div><br>
<div id=text_1_2 style="margin-left:200" class=general>
teddfg ejwrhtwjkerhtjwekrhtwjlerht bn sadfbasdnfb asdfnbm asdfnb<br>
sadfasdf wert ewrtrty rety yturtu<br>
asfsdfsda rtuytyurtyu jghmkjmglkhjmkghm gfhj ghj
</div>

<div id=click_1_2_1 class=span_general onclick=javascript:collapse('1_2_1') onmouseover=javascript:objectOver(this) onmouseout=javascript:objectOut(this) style="margin-left:300;position:relative;left:-25;top:14" > - </div>
<div style="margin-left:300;display:block" class=general>
Text 1_2_1 TITLE bla bla
</div><br>
<div id=text_1_2_1 style="margin-left:300;display:block" class=general>

teddfg ejwrhtwjkerhtjwekrhtwjlerht bn sadfbasdnfb asdfnbm asdfnb<br>
sadfasdf wert ewrtrty rety yturtu<br>
asfsdfsda rtuytyurtyu jghmkjmglkhjmkghm gfhj ghj
</div>



<div id=click_1_3 class=span_general onclick=javascript:collapse('1_3') onmouseover=javascript:objectOver(this) onmouseout=javascript:objectOut(this) style="margin-left:200;position:relative;left:-25;top:14" > - </div>
<div style="margin-left:200;display:block" class=general>
Text 1_3 TITLE bla bla
</div><br>
<div id=text_1_3 style="margin-left:200" class=general>

teddfg ejwrhtwjkerhtjwekrhtwjlerht bn sadfbasdnfb asdfnbm asdfnb<br>
sadfasdf wert ewrtrty rety yturtu<br>
asfsdfsda rtuytyurtyu jghmkjmglkhjmkghm gfhj ghj
</div>

</body>
</html>


Still have questions? Ask your question on TechOnlineHelp.com or find more examples on www.netartmedia.net/examples




If this example was useful for you, please support my company and click Like on the button below. Thank you very much!



Jobs Portal, poweful jobs board software

PHP Mall, multi vendors mall website software

Car Portal, php script for auto classifieds websites

NetArt Media, software products and services

Real Estate Portal, web software for real estate portals

Blog System, multi user blog hosting script

PHP Store, powerful e-commerce system written in PHP

Pharmacy System, software for running online pharmacies

C# (Microsoft .NET) | JAVA | Dynamic HTML | PHP & MySQL | Perl & CGI | C | C++ | Vector Markup Language
SMIL | Assembler | Databases | Wap Development | Web site promotion | Web Marketing

Copyright Anton Zamov 1998-2012