dcmk
14 Sep 2009, 02:48 PM
Hi all, new here. I am currently learning and have a pretty good knowledge of html and asp, php, jsp etc but when it comes to javascript and css.. i am not afraid to admit completely out of my element.
I tried to do a nested table which works.. but there is whitespace where the 'bullet point' would be. and i can't make them side by side.. i cant explain it well.. so will link and you can see my delima.
http://www.bath-depot.co.uk/TEST.ASP
CSS
<style type="text/css">
.sidebarmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
font: bold 13px Verdana;
width: 180px; /* Main Menu Item widths */
border-bottom: 1px solid #ccc;
}
.sidebarmenu ul li{
position: relative;
}
/* Top level menu links style */
.sidebarmenu ul li a{
display: block;
overflow: auto; /*force hasLayout in IE7 */
color: white;
text-decoration: none;
padding: 6px;
border-bottom: 1px solid #778;
border-right: 1px solid #778;
}
.sidebarmenu ul li a:link, .sidebarmenu ul li a:visited, .sidebarmenu ul li a:active{
background-color: #012D58; /*background of tabs (default state)*/
}
.sidebarmenu ul li a:visited{
color: white;
}
.sidebarmenu ul li a:hover{
background-color: black;
}
/*Sub level menu items */
.sidebarmenu ul li ul{
position: absolute;
width: 170px; /*Sub Menu Items width */
top: 0;
visibility: hidden;
}
.sidebarmenu a.subfolderstyle{
background: url(right.gif) no-repeat 97% 50%;
}
/* Holly Hack for IE \*/
* html .sidebarmenu ul li { float: left; height: 1%; }
* html .sidebarmenu ul li a { height: 1%; }
/* End */
</style>
HTML
<script type="text/javascript">
var menuids=["sidebarmenu1"]
function initsidebarmenu(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
if (ultags[t].parentNode.parentNode.id==menuids[i])
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px"
else
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
for (var t=ultags.length-1; t>-1; t--){
ultags[t].style.visibility="visible"
ultags[t].style.display="none"
}
}
}
if (window.addEventListener)
window.addEventListener("load", initsidebarmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", initsidebarmenu)
</script>
<LINK HREF='assets/styles/BB4menu.css' REL='stylesheet' TYPE='text/css'>
</HEAD>
<BODY>
<table width="15%" cellspacing="0" cellpadding="0"><td>
<div class="sidebarmenu">
<ul id="sidebarmenu1">
<li><a href="#">Accessories</a></li>
<li><a href="#">Basins</a></li>
<li><a href="#">Baths</a><!--/li>-->
<ul>
<li><a href="#">Common Baths</a></li>
<li><a href="#">Whirlpool Baths</a></li>
</ul>
<li><a href="#">Mirrors</a></li>
<li><a href="#">Showers</a><!--/li>-->
<ul>
<li><a href="#">Enclosures</a></li>
<li><a href="#">Screens</a></li>
<li><a href="#">Steam</a><!--/li>-->
</ul>
</li>
<li><a href="#">Taps and Trays</a><!--/li>-->
<ul>
<li><a href="#">Bath Taps</a></li>
<li><a href="#">Mira Shower Trays</a></li>
<li><a href="#">Monobloc Taps</a>
<ul>
<li><a href="#">Work??</a></li>
</ul>
<li><a href="#">Towel Rails</a></li>
</ul>
<li><a href="#">Vanity Units</a><!--/li>-->
<ul><li><a href="#">Single</a></li>
<li><a href="#">Double</a></li>
</ul>
</li>
<li><a href="#">WC's</a></li>
</li>
</ul>
</div>
</td>
</table>
</HTML>
Please if anyone can shed some light and what was wrong would be eternally grateful. thank you
I tried to do a nested table which works.. but there is whitespace where the 'bullet point' would be. and i can't make them side by side.. i cant explain it well.. so will link and you can see my delima.
http://www.bath-depot.co.uk/TEST.ASP
CSS
<style type="text/css">
.sidebarmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
font: bold 13px Verdana;
width: 180px; /* Main Menu Item widths */
border-bottom: 1px solid #ccc;
}
.sidebarmenu ul li{
position: relative;
}
/* Top level menu links style */
.sidebarmenu ul li a{
display: block;
overflow: auto; /*force hasLayout in IE7 */
color: white;
text-decoration: none;
padding: 6px;
border-bottom: 1px solid #778;
border-right: 1px solid #778;
}
.sidebarmenu ul li a:link, .sidebarmenu ul li a:visited, .sidebarmenu ul li a:active{
background-color: #012D58; /*background of tabs (default state)*/
}
.sidebarmenu ul li a:visited{
color: white;
}
.sidebarmenu ul li a:hover{
background-color: black;
}
/*Sub level menu items */
.sidebarmenu ul li ul{
position: absolute;
width: 170px; /*Sub Menu Items width */
top: 0;
visibility: hidden;
}
.sidebarmenu a.subfolderstyle{
background: url(right.gif) no-repeat 97% 50%;
}
/* Holly Hack for IE \*/
* html .sidebarmenu ul li { float: left; height: 1%; }
* html .sidebarmenu ul li a { height: 1%; }
/* End */
</style>
HTML
<script type="text/javascript">
var menuids=["sidebarmenu1"]
function initsidebarmenu(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
if (ultags[t].parentNode.parentNode.id==menuids[i])
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px"
else
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
for (var t=ultags.length-1; t>-1; t--){
ultags[t].style.visibility="visible"
ultags[t].style.display="none"
}
}
}
if (window.addEventListener)
window.addEventListener("load", initsidebarmenu, false)
else if (window.attachEvent)
window.attachEvent("onload", initsidebarmenu)
</script>
<LINK HREF='assets/styles/BB4menu.css' REL='stylesheet' TYPE='text/css'>
</HEAD>
<BODY>
<table width="15%" cellspacing="0" cellpadding="0"><td>
<div class="sidebarmenu">
<ul id="sidebarmenu1">
<li><a href="#">Accessories</a></li>
<li><a href="#">Basins</a></li>
<li><a href="#">Baths</a><!--/li>-->
<ul>
<li><a href="#">Common Baths</a></li>
<li><a href="#">Whirlpool Baths</a></li>
</ul>
<li><a href="#">Mirrors</a></li>
<li><a href="#">Showers</a><!--/li>-->
<ul>
<li><a href="#">Enclosures</a></li>
<li><a href="#">Screens</a></li>
<li><a href="#">Steam</a><!--/li>-->
</ul>
</li>
<li><a href="#">Taps and Trays</a><!--/li>-->
<ul>
<li><a href="#">Bath Taps</a></li>
<li><a href="#">Mira Shower Trays</a></li>
<li><a href="#">Monobloc Taps</a>
<ul>
<li><a href="#">Work??</a></li>
</ul>
<li><a href="#">Towel Rails</a></li>
</ul>
<li><a href="#">Vanity Units</a><!--/li>-->
<ul><li><a href="#">Single</a></li>
<li><a href="#">Double</a></li>
</ul>
</li>
<li><a href="#">WC's</a></li>
</li>
</ul>
</div>
</td>
</table>
</HTML>
Please if anyone can shed some light and what was wrong would be eternally grateful. thank you