timole99
10-24-2007, 01:11 AM
Using neat CSS Horizontal List Menu from JavaScript Kit sourced here -
http://www.javascriptkit.com/script/script2/csstopmenu.shtml
on my website here - http://bioenergy.timleitch.net.nz/index.html
The JKS page has both original .css (and .js) files click link visible.
PROBLEM IS -
I have just expanded to 2 main menus to accomodate the expanding amount of info I have available about the adverse health effects of EMFs and electropollution. This works fine in Firefox but in not in IE Internet Explorer. Perhaps "Holly Hack" isn't right or needs something more.
With IE, the properly displaying DropDown for the upper layer menu disappears when mouse is brought down (what should be the dropdown display in order to click on a DD item) and goes over the lower layer menu. This means the Lower Menu works fine in all respect but Upper Menu is value is lost and largely ineffective.
Two or more Menus are allowed in javascript file
The original JKS .js file says 2 or more menus are possible in this code -
http://www.javascriptkit.com/script/script2/csshorizontalmenu.js
var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.
I have modified this in my .js file to -
var cssmenuids=["cssmenu1","cssmenu_2"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.
CSS file and changes
The original JKS .css file has this code to provide for IE -
http://www.javascriptkit.com/script/script2/csshorizontalmenu.css
* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/
padding-top: 1em;
}
/* Holly Hack for IE \*/
* html .horizontalcssmenu ul li { float: left; height: 1%; }
* html .horizontalcssmenu ul li a { height: 1%; }
/* End */
I have modified this Holly Hack in my .css file to (at very bottom) -
To be helpful I've shown the whole .css file as I am not familiar with CSS and from all my extensive searching on Coding Forums and reading a great number related to CSS distortions in IE, it may be that may be just one or two tiny element changes that might rectify my issue that I URGENTLY need to rectify this problem.
.horizontalcssmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}
/*Top level list items*/
.horizontalcssmenu ul li{
position: relative;
display: inline;
float: left;
}
/*Top level menu link items style*/
.horizontalcssmenu ul li a{
display: block;
width: 90px; /*Width of top level menu link items*/
padding: 2px 8px;
border: 1px solid white;
border-left-width: 0;
text-decoration: none;
background: url("menubg.gif") center center repeat-x;
color: white;
font: normal 12px Tahoma;
}
/*Sub level menu*/
.horizontalcssmenu ul li ul{
left: 0;
top: 0;
border-top: 1px medium #202020;
position: absolute;
display: block;
visibility: hidden;
z-index: 100;
}
/*Sub level menu list items*/
.horizontalcssmenu ul li ul li{
display: inline;
float: none;
}
/* Sub level menu links style */
.horizontalcssmenu ul li ul li a{
width: 200px; /*width of sub menu levels*/
padding: 2px 5px;
background: #cae2fd;
border: 1px #202020;
border-width: 0 1px 1px 1px;
font: normal 12px Tahoma;
color: black;
}
.horizontalcssmenu ul li a:hover{
background: url("menubgover.gif") center center repeat-x;
border: 1px solid #ffcc00;
color: #ffcc00;
font: bold 11px Tahoma;
}
.horizontalcssmenu ul li ul li a:hover{
background: #7db8fb;
color: black;
font: bold 12px Tahoma;
}
.horizontalcssmenu .arrowdiv{
position: absolute;
right: 0;
background: transparent url("menuarrow.gif") no-repeat center left;
}
* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/
padding-top: 1em;
}
/* Holly Hack for IE \*/
* html .horizontalcssmenu ul li { float: left; height: 1%; }
* html p#iepara{padding-top: 1em; }
* html .horizontalcssmenu ul li a { height: 1%; }
/* End */
I do hope you will be able to offer a solution. Please explain what I'll need to do as clearly as you can since I'm not an expert in programming. Thanks in anticipation.
Regards,
Tim
Tim@TimLeitch.net.nz
http://TimLeitch.net.nz
http://www.javascriptkit.com/script/script2/csstopmenu.shtml
on my website here - http://bioenergy.timleitch.net.nz/index.html
The JKS page has both original .css (and .js) files click link visible.
PROBLEM IS -
I have just expanded to 2 main menus to accomodate the expanding amount of info I have available about the adverse health effects of EMFs and electropollution. This works fine in Firefox but in not in IE Internet Explorer. Perhaps "Holly Hack" isn't right or needs something more.
With IE, the properly displaying DropDown for the upper layer menu disappears when mouse is brought down (what should be the dropdown display in order to click on a DD item) and goes over the lower layer menu. This means the Lower Menu works fine in all respect but Upper Menu is value is lost and largely ineffective.
Two or more Menus are allowed in javascript file
The original JKS .js file says 2 or more menus are possible in this code -
http://www.javascriptkit.com/script/script2/csshorizontalmenu.js
var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.
I have modified this in my .js file to -
var cssmenuids=["cssmenu1","cssmenu_2"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.
CSS file and changes
The original JKS .css file has this code to provide for IE -
http://www.javascriptkit.com/script/script2/csshorizontalmenu.css
* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/
padding-top: 1em;
}
/* Holly Hack for IE \*/
* html .horizontalcssmenu ul li { float: left; height: 1%; }
* html .horizontalcssmenu ul li a { height: 1%; }
/* End */
I have modified this Holly Hack in my .css file to (at very bottom) -
To be helpful I've shown the whole .css file as I am not familiar with CSS and from all my extensive searching on Coding Forums and reading a great number related to CSS distortions in IE, it may be that may be just one or two tiny element changes that might rectify my issue that I URGENTLY need to rectify this problem.
.horizontalcssmenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}
/*Top level list items*/
.horizontalcssmenu ul li{
position: relative;
display: inline;
float: left;
}
/*Top level menu link items style*/
.horizontalcssmenu ul li a{
display: block;
width: 90px; /*Width of top level menu link items*/
padding: 2px 8px;
border: 1px solid white;
border-left-width: 0;
text-decoration: none;
background: url("menubg.gif") center center repeat-x;
color: white;
font: normal 12px Tahoma;
}
/*Sub level menu*/
.horizontalcssmenu ul li ul{
left: 0;
top: 0;
border-top: 1px medium #202020;
position: absolute;
display: block;
visibility: hidden;
z-index: 100;
}
/*Sub level menu list items*/
.horizontalcssmenu ul li ul li{
display: inline;
float: none;
}
/* Sub level menu links style */
.horizontalcssmenu ul li ul li a{
width: 200px; /*width of sub menu levels*/
padding: 2px 5px;
background: #cae2fd;
border: 1px #202020;
border-width: 0 1px 1px 1px;
font: normal 12px Tahoma;
color: black;
}
.horizontalcssmenu ul li a:hover{
background: url("menubgover.gif") center center repeat-x;
border: 1px solid #ffcc00;
color: #ffcc00;
font: bold 11px Tahoma;
}
.horizontalcssmenu ul li ul li a:hover{
background: #7db8fb;
color: black;
font: bold 12px Tahoma;
}
.horizontalcssmenu .arrowdiv{
position: absolute;
right: 0;
background: transparent url("menuarrow.gif") no-repeat center left;
}
* html p#iepara{ /*For a paragraph (if any) that immediately follows menu, add 1em top spacing between the two in IE*/
padding-top: 1em;
}
/* Holly Hack for IE \*/
* html .horizontalcssmenu ul li { float: left; height: 1%; }
* html p#iepara{padding-top: 1em; }
* html .horizontalcssmenu ul li a { height: 1%; }
/* End */
I do hope you will be able to offer a solution. Please explain what I'll need to do as clearly as you can since I'm not an expert in programming. Thanks in anticipation.
Regards,
Tim
Tim@TimLeitch.net.nz
http://TimLeitch.net.nz