My previous post got squashed because m post is too long. Sorry for that:
I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks on one of the details in the main blue section. This only occurs in IE6. IE7 and FF work correctly.
The URL to the page is:
Steps to reproduce:
1. Mouse over the top menu and verify the hover works.
2. Click on the circle with the number "1" in it.
3. Mouse over the top menu again. The items no longer light up and the "Products" flyout no longer appears.
I use a JavaScript routine to add an event handler for IE6, so that hover works. A also use VB code-behind for the download functionality.
I will post the CSS, VB code, HTML and the JavaScript below.
The code in "capcss.css " is:
[CODE=css]body
{ background-image:url(image s/capback.jpg);}
#caplogo
{ margin:32px 0px 10px 10px;}
/*Middle Graphic******** *************** *********/
#leftside
{ float:left;}
#leftsideimage
{
float:left;
width:17px;
height:175px;
margin:0px;
background-image:url(image s/leftside.jpg);
}
#rightside
{
float:left;
width:793px;
height:175px;
background-image:url(image s/rightside.jpg);
margin-right:-5px; /*IE6 Hack. IE adds pixels to the right margin of the last item floated to the left*/
}
.fullpagewidth
{ width:979px;}
/*Menu on front page*********** ***/
#menu{ width:169px; float:left;}
#capmenu,
#capmenu ul
{
float:left;
padding:0 0 0 0;
margin:0;
list-style:none;
background-image:url(image s/leftmenuback.jp g);
position:relati ve;
z-index:200;
width:169px;
height:175px;
/*font: 16px verdana, sans-serif; */
font-family:Arial;
font-size:10pt;
font-weight:bold;
}
#capmenu li li
{ background-image:url(image s/leftmenuback.jp g);}
/* a hack for IE5.x and IE6 */
* html #capmenu li
{ float:left;}
#capmenu li a /*text for menu links on left-hand side. original*/
{
height:25px;
padding:0 0 0 5px;
color:rgb(0, 0, 0);
text-decoration:none ;
white-space:nowrap;
display:block;
width:169px;
}
#capmenu li:hover
{ position:relati ve; z-index:300; background:url( images/menulit.jpg);}
#capmenu ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*hack for IE6 */
* html #capmenu, * html capmenu ul
{ width:1px;}
/*flyout pop-up*/
#capmenu li:hover > ul
{
left:-15px;
top:-1px;
margin-left:100%;
width:229px;
height:100px;
}[/code]
[code=css]/*hide sub menu*/
#capmenu li:hover > ul ul
{ position:absolu te; left:-9999px; top:-9999px; width:auto;}
/* show path followed */
#capmenu li:hover > a
{ text-decoration:none ; color: rgb(250, 250, 250);}
/*IE6 Hack flyout pop-up*/
#capmenu li:hover ul
{
left:-15px;
top:-1px;
margin-left:100%;
width:229px;
height:100px;
}
/*IE6 Hide sub menu*/
#capmenu li:hover ul ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*IE6 show path followed */
#capmenu li:hover a,
#capmenu li:hover li:hover a
{ text-decoration:none ; color: rgb(250, 250, 250);}
/*IE6 hide futher possible paths */
#capmenu li:hover li a
{
text-decoration:none ;
color:#000;
width:229px; /*IE6 Hack to make lit background full menu width, and not just the width of the text*/
}
/*************** *************** *************** *************** *************** ***************/
[/code][code=css]#capcontainer
{
float:left;
width:991px;
height:540px;
position:absolu te;
left:0px;
top:0px;
}
#capleft
{
float:left;
width:814px;
margin-right:-3px;
height:530px;
}
#topcontainer
{ float:left; width:611px;}
#topdiecontaine r
{ float:left; width:775px}
#pagetitle
{ width:611px; height:56px; float:left;}
#topofpagetext
{ width:600px; float:right; padding-right:5px;}
.tabletext
{
margin-bottom:5px;
border-bottom:solid thin black;
width:600px;
float:left;
font-family:Arial;
font-size:smaller;
font-weight:bold;
}
.rightmenu
{
background-image:url(image s/ppage/rightpanelcss.j pg);
background-repeat:no-repeat;
width:180px;
height:530px;
padding-top:4px;
float:right;
}
.rightul
{
float:left;
list-style-type:none;
padding:0;
margin:14px 0px 0px 4px;
}
.rightli
{ width:168px; background-color:rgb(204,2 04,204); padding:0px 0px 0px 5px;}
* html .rightul /*IE6 Hack*/
{ width:173px; margin-left:2px;}
/*Header text for entrances.aspx*/
#htsystem
{ float:left; margin:0px 38px 0px 25px;}
#htstyle
{ float:left; margin:0px 28px 0px 20px;}
.htrailbottom
{ float:left; margin:0px 28px 0px 5px;}
#httraffic
{ float:left; margin:0px 5px 0px 5px;}
#htnarrow
{ float:left; margin:0px 10px 0px 5px;}
#htlinetwo
{ float:left; margin:0px 33px 0px 5px;}
#htlinethree
{ float:left; margin:0px 23px 0px 5px;}
#htlinefour
{ float:left; margin:0px 28px 0px 5px;}
.htlinefivesix
{ float:left; margin:0px 23px 0px 20px;}
/*Top Menu*********** *************** *************** **/
#topmenu,
#topmenu ul
{
padding:0;
margin:0;
list-style:none;
font: 10px verdana, sans-serif;
background-image:url(image s/menu/topmenuback.jpg );
border:0;
position:relati ve;
z-index:200;
}
#topmenu
{ height:20px; padding:0;}
#topmenu li
{ float:left;}
#topmenu li li
{ float:none; background:#ccc ;}
[/code][code=css]
/*hack for IE6 */
* html #topmenu li li
{ float:left;}
#topmenu li a
{
display:block;
float:left;
color:#000;
height:20px;
line-height:15px;
text-decoration:none ;
white-space:nowrap;
font-weight:bold;
}
#topmenu li li a
{ height:20px; line-height:20px; float:none;}
#topmenu li:hover
{ position:relati ve; z-index:300;}
#topmenu li:hover ul
{
left:0;
top:18px;
height:80px;
background:#ccc ;
border-bottom:solid thin white;
border-right:solid thin white;
border-left:solid thin white;
width:140px;
}
/*hack for IE6 */
* html #topmenu li:hover ul
{ left:0px;}
#topmenu ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*hack for IE6 */
* html #topmenu ul
{ width:1px;}
/* show next level */
#topmenu li:hover li:hover > ul
{ left:-15px; margin-left:100%; top:-1px;}
/* keep further levels hidden */
#topmenu li:hover > ul ul
{
position:absolu te;
left:-9999px;
top:-9999px;
width:auto;
}
/* show path followed */
#topmenu li:hover > a
{ text-decoration:none ; color:#fff;}
/*flyout dropdown */
#topmenu li:hover li:hover ul
{ left:-15px; margin-left:100%; top:-1px;}
/*hide sub menu*/
#topmenu li:hover ul ul
{ position:absolu te; left:-9999px; top:-9999px;}
/* show path followed */
#topmenu li:hover a,
#topmenu li:hover li:hover a
{ text-decoration:none ; color:#fff;}
/* hide futher possible paths */
#topmenu li:hover li a,
#topmenu li:hover li:hover li a
{ text-decoration:none ; color:#000;}
/*die pages********** *************** *************** *************** *********/[/code]
[code=css]#diepagecontain er
{ width:979px; height:552px;}
#dienodecontain er
{ height:357px; width:618px; float:left;}
#dieulcontainer
{
list-style:none;
width:618px;
height:357px;
margin:0;
padding:0;
}
.licontainer
{ float:left; width:618px;}
#dierightpanelc ontainer
{
width:157px;
height:357px;
float:left;
background-image:url(image s/filepanel/rightfilepane.g if);
}
#diebottomconta iner
{ width:778px; float:left;}
/*CAPDOwnload page*********** *************** *************** *************** **/
#downloadcontai ner
{ width:814px;}
#downloadleft
{
float:left;
width:814px;
position:absolu te;
left:0;
top:0;
margin-right:-3px;
}
#downloadcustsv c
{
margin-left:201px;
height:220px;
margin-top:21px;
width:601px;
padding:0px 0px 0px 10px;
}
#downloadtitlec ustsvc
{ width:611px; margin-top:10px; margin-bottom:10px;}
#downloadcustsv cleft
{ float:left; width:218px;}
#downloadcustsv cright
{ float:right; width:238px;}
#downloadtitlec redit
{
width:601px;
margin-left:201px;
margin-top:10px;
margin-bottom:10px;
}
#downloadcredit
{
width:601px;
margin-left:201px;
height:120px;
padding:0px 0px 0px 10px;
}
#downloadcredit left
{ float:left; width:218px;}
#downloadtitlel iterature
{
width:611px;
margin-left:201px;
margin-top:10px;
margin-bottom:10px;
}
#downloadlitera ture
{
width:611px;
height:40px;
margin-left:201px;
padding:0px 0px 0px 10px;
}
#downloadlitera tureleft
{ float:left; width:218px;}
#downloadlitera tureright
{ float:right; width:238px;}
a.download{font-family:Arial; font-size:x-small;}
a.download:link {color: black; text-decoration: none;}
a.download:visi ted {color: black; text-decoration: none;}
a.download:back ground-color {color:white; text-decoration: none;}
a.download:hove r {color: black; text-decoration: none; background-color: #aaaaaa;}
a.title{ font-family:Arial Black; font-size:small;}
/****companyinfo .aspx********** *************** *************** *************** *****/
#companyinfotit le
{
display:block;
width:600px;
margin-left:201px;
margin-top:40px;
height:20px;
padding:0px 0px 0px 10px;
}
#companyinfocon tainer
{ width:600px; float:right; padding-top:10px;}
p.text{ font-family:Arial; font-size:small; font-weight:bold;}
/******gallery.a spx************ *************** *************** *************** *****/
p.gallery
{ font-family:Arial; font-size:larger; font-weight:bold; text-align:center; margin-top:30%;}
#gallerycontain er
{ width:600px; height:530px; margin:21px 0px 0px 201px;}
[/CODE]
The code in "tophover.j s" is:
[CODE=javascript]Hover = function() {
var cssRule;
var newSelector;
for (var i = 0; i < document.styleS heets.length; i++)
for (var x = 0; x < document.styleS heets[i].rules.length ; x++)
{
cssRule = document.styleS heets[i].rules[x];
if (cssRule.select orText.indexOf( "LI:hover") != -1)
{
newSelector = cssRule.selecto rText.replace(/LI:hover/gi, "LI.iehover ");
document.styleS heets[i].addRule(newSel ector , cssRule.style.c ssText);
}
}
var getElm = document.getEle mentById("topme nu").getElement sByTagName("LI" );
for (var i=0; i<getElm.length ; i++) {
getElm[i].onmouseover=fu nction() {
this.className+ =" iehover";
}
getElm[i].onmouseout=fun ction() {
this.className= this.className. replace(new RegExp(" iehover\\b"), "");
}
}
}
if (window.attachE vent) window.attachEv ent("onload", Hover);
[/CODE]
HTML code is posted in the 2nd post. VERY sorry for this.
I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks on one of the details in the main blue section. This only occurs in IE6. IE7 and FF work correctly.
The URL to the page is:
Steps to reproduce:
1. Mouse over the top menu and verify the hover works.
2. Click on the circle with the number "1" in it.
3. Mouse over the top menu again. The items no longer light up and the "Products" flyout no longer appears.
I use a JavaScript routine to add an event handler for IE6, so that hover works. A also use VB code-behind for the download functionality.
I will post the CSS, VB code, HTML and the JavaScript below.
The code in "capcss.css " is:
[CODE=css]body
{ background-image:url(image s/capback.jpg);}
#caplogo
{ margin:32px 0px 10px 10px;}
/*Middle Graphic******** *************** *********/
#leftside
{ float:left;}
#leftsideimage
{
float:left;
width:17px;
height:175px;
margin:0px;
background-image:url(image s/leftside.jpg);
}
#rightside
{
float:left;
width:793px;
height:175px;
background-image:url(image s/rightside.jpg);
margin-right:-5px; /*IE6 Hack. IE adds pixels to the right margin of the last item floated to the left*/
}
.fullpagewidth
{ width:979px;}
/*Menu on front page*********** ***/
#menu{ width:169px; float:left;}
#capmenu,
#capmenu ul
{
float:left;
padding:0 0 0 0;
margin:0;
list-style:none;
background-image:url(image s/leftmenuback.jp g);
position:relati ve;
z-index:200;
width:169px;
height:175px;
/*font: 16px verdana, sans-serif; */
font-family:Arial;
font-size:10pt;
font-weight:bold;
}
#capmenu li li
{ background-image:url(image s/leftmenuback.jp g);}
/* a hack for IE5.x and IE6 */
* html #capmenu li
{ float:left;}
#capmenu li a /*text for menu links on left-hand side. original*/
{
height:25px;
padding:0 0 0 5px;
color:rgb(0, 0, 0);
text-decoration:none ;
white-space:nowrap;
display:block;
width:169px;
}
#capmenu li:hover
{ position:relati ve; z-index:300; background:url( images/menulit.jpg);}
#capmenu ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*hack for IE6 */
* html #capmenu, * html capmenu ul
{ width:1px;}
/*flyout pop-up*/
#capmenu li:hover > ul
{
left:-15px;
top:-1px;
margin-left:100%;
width:229px;
height:100px;
}[/code]
[code=css]/*hide sub menu*/
#capmenu li:hover > ul ul
{ position:absolu te; left:-9999px; top:-9999px; width:auto;}
/* show path followed */
#capmenu li:hover > a
{ text-decoration:none ; color: rgb(250, 250, 250);}
/*IE6 Hack flyout pop-up*/
#capmenu li:hover ul
{
left:-15px;
top:-1px;
margin-left:100%;
width:229px;
height:100px;
}
/*IE6 Hide sub menu*/
#capmenu li:hover ul ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*IE6 show path followed */
#capmenu li:hover a,
#capmenu li:hover li:hover a
{ text-decoration:none ; color: rgb(250, 250, 250);}
/*IE6 hide futher possible paths */
#capmenu li:hover li a
{
text-decoration:none ;
color:#000;
width:229px; /*IE6 Hack to make lit background full menu width, and not just the width of the text*/
}
/*************** *************** *************** *************** *************** ***************/
[/code][code=css]#capcontainer
{
float:left;
width:991px;
height:540px;
position:absolu te;
left:0px;
top:0px;
}
#capleft
{
float:left;
width:814px;
margin-right:-3px;
height:530px;
}
#topcontainer
{ float:left; width:611px;}
#topdiecontaine r
{ float:left; width:775px}
#pagetitle
{ width:611px; height:56px; float:left;}
#topofpagetext
{ width:600px; float:right; padding-right:5px;}
.tabletext
{
margin-bottom:5px;
border-bottom:solid thin black;
width:600px;
float:left;
font-family:Arial;
font-size:smaller;
font-weight:bold;
}
.rightmenu
{
background-image:url(image s/ppage/rightpanelcss.j pg);
background-repeat:no-repeat;
width:180px;
height:530px;
padding-top:4px;
float:right;
}
.rightul
{
float:left;
list-style-type:none;
padding:0;
margin:14px 0px 0px 4px;
}
.rightli
{ width:168px; background-color:rgb(204,2 04,204); padding:0px 0px 0px 5px;}
* html .rightul /*IE6 Hack*/
{ width:173px; margin-left:2px;}
/*Header text for entrances.aspx*/
#htsystem
{ float:left; margin:0px 38px 0px 25px;}
#htstyle
{ float:left; margin:0px 28px 0px 20px;}
.htrailbottom
{ float:left; margin:0px 28px 0px 5px;}
#httraffic
{ float:left; margin:0px 5px 0px 5px;}
#htnarrow
{ float:left; margin:0px 10px 0px 5px;}
#htlinetwo
{ float:left; margin:0px 33px 0px 5px;}
#htlinethree
{ float:left; margin:0px 23px 0px 5px;}
#htlinefour
{ float:left; margin:0px 28px 0px 5px;}
.htlinefivesix
{ float:left; margin:0px 23px 0px 20px;}
/*Top Menu*********** *************** *************** **/
#topmenu,
#topmenu ul
{
padding:0;
margin:0;
list-style:none;
font: 10px verdana, sans-serif;
background-image:url(image s/menu/topmenuback.jpg );
border:0;
position:relati ve;
z-index:200;
}
#topmenu
{ height:20px; padding:0;}
#topmenu li
{ float:left;}
#topmenu li li
{ float:none; background:#ccc ;}
[/code][code=css]
/*hack for IE6 */
* html #topmenu li li
{ float:left;}
#topmenu li a
{
display:block;
float:left;
color:#000;
height:20px;
line-height:15px;
text-decoration:none ;
white-space:nowrap;
font-weight:bold;
}
#topmenu li li a
{ height:20px; line-height:20px; float:none;}
#topmenu li:hover
{ position:relati ve; z-index:300;}
#topmenu li:hover ul
{
left:0;
top:18px;
height:80px;
background:#ccc ;
border-bottom:solid thin white;
border-right:solid thin white;
border-left:solid thin white;
width:140px;
}
/*hack for IE6 */
* html #topmenu li:hover ul
{ left:0px;}
#topmenu ul
{ position:absolu te; left:-9999px; top:-9999px;}
/*hack for IE6 */
* html #topmenu ul
{ width:1px;}
/* show next level */
#topmenu li:hover li:hover > ul
{ left:-15px; margin-left:100%; top:-1px;}
/* keep further levels hidden */
#topmenu li:hover > ul ul
{
position:absolu te;
left:-9999px;
top:-9999px;
width:auto;
}
/* show path followed */
#topmenu li:hover > a
{ text-decoration:none ; color:#fff;}
/*flyout dropdown */
#topmenu li:hover li:hover ul
{ left:-15px; margin-left:100%; top:-1px;}
/*hide sub menu*/
#topmenu li:hover ul ul
{ position:absolu te; left:-9999px; top:-9999px;}
/* show path followed */
#topmenu li:hover a,
#topmenu li:hover li:hover a
{ text-decoration:none ; color:#fff;}
/* hide futher possible paths */
#topmenu li:hover li a,
#topmenu li:hover li:hover li a
{ text-decoration:none ; color:#000;}
/*die pages********** *************** *************** *************** *********/[/code]
[code=css]#diepagecontain er
{ width:979px; height:552px;}
#dienodecontain er
{ height:357px; width:618px; float:left;}
#dieulcontainer
{
list-style:none;
width:618px;
height:357px;
margin:0;
padding:0;
}
.licontainer
{ float:left; width:618px;}
#dierightpanelc ontainer
{
width:157px;
height:357px;
float:left;
background-image:url(image s/filepanel/rightfilepane.g if);
}
#diebottomconta iner
{ width:778px; float:left;}
/*CAPDOwnload page*********** *************** *************** *************** **/
#downloadcontai ner
{ width:814px;}
#downloadleft
{
float:left;
width:814px;
position:absolu te;
left:0;
top:0;
margin-right:-3px;
}
#downloadcustsv c
{
margin-left:201px;
height:220px;
margin-top:21px;
width:601px;
padding:0px 0px 0px 10px;
}
#downloadtitlec ustsvc
{ width:611px; margin-top:10px; margin-bottom:10px;}
#downloadcustsv cleft
{ float:left; width:218px;}
#downloadcustsv cright
{ float:right; width:238px;}
#downloadtitlec redit
{
width:601px;
margin-left:201px;
margin-top:10px;
margin-bottom:10px;
}
#downloadcredit
{
width:601px;
margin-left:201px;
height:120px;
padding:0px 0px 0px 10px;
}
#downloadcredit left
{ float:left; width:218px;}
#downloadtitlel iterature
{
width:611px;
margin-left:201px;
margin-top:10px;
margin-bottom:10px;
}
#downloadlitera ture
{
width:611px;
height:40px;
margin-left:201px;
padding:0px 0px 0px 10px;
}
#downloadlitera tureleft
{ float:left; width:218px;}
#downloadlitera tureright
{ float:right; width:238px;}
a.download{font-family:Arial; font-size:x-small;}
a.download:link {color: black; text-decoration: none;}
a.download:visi ted {color: black; text-decoration: none;}
a.download:back ground-color {color:white; text-decoration: none;}
a.download:hove r {color: black; text-decoration: none; background-color: #aaaaaa;}
a.title{ font-family:Arial Black; font-size:small;}
/****companyinfo .aspx********** *************** *************** *************** *****/
#companyinfotit le
{
display:block;
width:600px;
margin-left:201px;
margin-top:40px;
height:20px;
padding:0px 0px 0px 10px;
}
#companyinfocon tainer
{ width:600px; float:right; padding-top:10px;}
p.text{ font-family:Arial; font-size:small; font-weight:bold;}
/******gallery.a spx************ *************** *************** *************** *****/
p.gallery
{ font-family:Arial; font-size:larger; font-weight:bold; text-align:center; margin-top:30%;}
#gallerycontain er
{ width:600px; height:530px; margin:21px 0px 0px 201px;}
[/CODE]
The code in "tophover.j s" is:
[CODE=javascript]Hover = function() {
var cssRule;
var newSelector;
for (var i = 0; i < document.styleS heets.length; i++)
for (var x = 0; x < document.styleS heets[i].rules.length ; x++)
{
cssRule = document.styleS heets[i].rules[x];
if (cssRule.select orText.indexOf( "LI:hover") != -1)
{
newSelector = cssRule.selecto rText.replace(/LI:hover/gi, "LI.iehover ");
document.styleS heets[i].addRule(newSel ector , cssRule.style.c ssText);
}
}
var getElm = document.getEle mentById("topme nu").getElement sByTagName("LI" );
for (var i=0; i<getElm.length ; i++) {
getElm[i].onmouseover=fu nction() {
this.className+ =" iehover";
}
getElm[i].onmouseout=fun ction() {
this.className= this.className. replace(new RegExp(" iehover\\b"), "");
}
}
}
if (window.attachE vent) window.attachEv ent("onload", Hover);
[/CODE]
HTML code is posted in the 2nd post. VERY sorry for this.
Comment