Sunday, November 20, 2011

javaScript Stuff

  
Step 1.
 <script type="text/javascript">
  function SwitchMenu(obj){
    if(document.getElementById)
{
    var el = document.getElementById(obj);
    var ar = document.getElementById("masterdiv").getElementsByTagName("span");
        if(el.style.display != "block"){
            for (var i=0; i<ar.length; i++){
                if (ar[i].className=="submenu")
                ar[i].style.display = "none";
            }
            el.style.display = "block";
        }else{
            el.style.display = "none";
        }
    }
}
</script>

------------------------------------
Step2.
   <div class="Demo" onclick="SwitchMenu('sub1')">
                              <img src="tidf.gif" width="12" height="19" border="1" />
                              </div>

--------------------------------
Step3.
<div id="masterdiv">
    <span class="submenu" id="sub1">

                          <table width="775" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                  

                                </tr>
                              </table>
                              </span>
                          </div>

No comments:

Post a Comment