Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > help for javascript,cs and html

Reply
Thread Tools

help for javascript,cs and html

 
 
brian
Guest
Posts: n/a
 
      01-08-2008
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;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
Need help with HTML coding for Index.html background image James O'Riley HTML 4 05-05-2006 02:28 AM
Help on HTML server control vs HTML control =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?= ASP .Net 5 09-15-2005 07:51 PM
Need help appending html code to many html files. Tom HTML 7 09-08-2004 11:55 PM
help! javascript inline of an HTML to open an HTML in a target window Lucy Javascript 6 01-01-2004 07:07 PM



Advertisments