help for javascript,cs and html

Discussion in 'HTML' started by brian, Jan 8, 2008.

  1. brian

    brian Guest

    problems :
    Menu is always flash when the mouse move over.and when expand one
    menu,other menus positons is moved.I don't want to move the menus
    positons when expanding some menu.

    Thanks

    my codes includes 3 files as the following:

    <<a.html>>

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
    TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=ISO-8859-1" />
    <meta name="GENERATOR" content="IBM Software Development Platform" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="stylesheet" type="text/css" href="leftmenu2.css" />
    <script type="text/javascript" src="leftmenu2.js"></script>
    <title>MetaData</title>
    </head>
    <body>
    <table width="100" border="0" cellpadding="0" cellspacing="0" >
    <tr>
    <td width="20">
    <div class="menu1" onmouseover="showHide('submenu1')">menu1</div>
    </td>
    <td width="20">
    <div class="menu1" onmouseover="showHide('submenu2')">menu2</div>
    </td>
    <td width="20">
    <div class="menu1" onmouseover="showHide('submenu3')">menu3</div>
    </td>
    <td width="20">
    <div class="menu1" onmouseover="showHide('submenu4')">menu4</div>
    </td>
    </tr>



    <tr>
    <td width="20">
    <div id="submenu1" class="hide">
    <a href="#" class="submenu">submenu1</a>
    <a href="#" class="submenu">submenu2222</a>
    <a href="#" class="submenu">submenu33333</a>
    </div>
    </td>
    <td width="20">
    <div id="submenu2" class="hide">
    <a href="#" class="submenu">submenu1</a>
    <a href="#" class="submenu">submenu2222</a>
    <a href="#" class="submenu">submenu33333</a>

    </div>
    </td>
    <td width="20">
    <div id="submenu3" class="hide">
    <a href="#" class="submenu">submenu1</a>
    <a href="#" class="submenu">submenu2222</a>
    <a href="#" class="submenu">submenu33333</a>
    </div>
    </td>
    <td width="20">
    <div id="submenu4" class="hide">
    <a href="#" class="submenu">submenu1</a>
    <a href="#" class="submenu">submenu2222</a>
    <a href="#" class="submenu">submenu33333</a>

    </div>
    </td>
    </tr>

    </table>

    </body>
    </html>



    <<leftmenu2.js>>

    var last_expanded = '';

    function showHide(id)
    {
    var obj = document.getElementById(id);

    var status = obj.className;

    if (status == 'hide') {

    if (last_expanded != '') {
    var last_obj = document.getElementById(last_expanded);
    last_obj.className = 'hide';
    }

    obj.className = 'show';

    last_expanded = id;
    } else {
    obj.className = 'hide';
    }
    }


    }


    <<leftmenu2.css>>

    ..submenu{
    /*background-image: url(../images/white.jpg);*/
    display: block;
    height: 19px;
    width:100px;
    margin-left: 38px;
    padding-top: 2px;
    padding-left: 7px;
    color: #333333;
    }
    ..submenu:hover{
    background-color: #5A8EC6;
    }

    ..leftmenu{
    /*background-image: url(../images/white.jpg);*/
    display: block;
    height: 19px;
    margin-left: 38px;
    width:100px;
    padding-top: 2px;
    padding-left: 7px;
    color: #333333;
    }
    ..leftmenu:hover{
    /*background-image: url(../images/white.jpg);*/
    background-color: #FFFFFF;
    }
    ..hide{
    display: none;
    }
    ..show{
    display: block;
    }
     
    brian, Jan 8, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dhanasankar S via DotNetMonster.com

    How to read the BODY of HTML file from another HTML file using javascript?

    Dhanasankar S via DotNetMonster.com, Feb 26, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    508
    =?Utf-8?B?dHBlcnJp?=
    Feb 28, 2005
  2. Adam Akhtar
    Replies:
    9
    Views:
    599
    Florian Gilcher
    Aug 16, 2008
  3. Lucy
    Replies:
    6
    Views:
    372
    Jim Ley
    Jan 1, 2004
  4. srinivas
    Replies:
    0
    Views:
    979
    srinivas
    Nov 18, 2005
  5. parez
    Replies:
    0
    Views:
    149
    parez
    Sep 11, 2007
Loading...

Share This Page