Making A Menu like control using Javascript

Hello Mate,

To have a menu control i just used a simple javasctipt function.And would like to share this with you.

In The Mark Up Page



Please find the coding in the attachment markuppage.txt



Javascript Function is




function showsubdiv(div1,div2,div3)
{
var show = document.getElementById(div1);
var hide1 = document.getElementById(div2);

var hide2 = document.getElementById(div3);

show.style.display = '';
hide1.style.display = 'none';
hide2.style.display = 'none';
}



And The Style Sheet classes are






.smenu
{
background-image: url(images/submenu.jpg);
height: auto;
margin: 0px;
width: 187px;
text-align: left;
vertical-align: middle;
top: 414px;
}

.submenualign
{
margin-top: 5px;
margin-right: 0px;
margin-bottom: 5px;
margin-left: 50px;
}



Explanation



What i have done is i have made three div tag for the content of the menu and i have just made its visiblity to none to all the divs.and i have a javascript function which will show the div whose id was passed as a first parameter and will hide the div whose id was passed not as the first parameter.

Note the line




Please Find the coding in the attachment Markupexplanation.txt


Cheers,
Myself


Attachments

  • MarkupExplanation (25187-202356-markupexplanation.txt)
  • Markuppage (25187-202357-MarkupPageCode.txt)
  • Comments

    No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: