473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hover menu opera bug

103 100+
Hello All

I have a 'flyout' css menu which uses something like this:

Expand|Select|Wrap|Line Numbers
  1. <ul>
  2.   <li><a>head</a><div style="position:absolute;left:-10000;"><ul><li>more</li><li>even more</li></ul></div></li>
  3.   <li><a>head</a><div style="position:absolute;left:-10000;"><ul><li>more</li><li>even more</li></ul></div></li>
  4. </ul>
  5.  
Expand|Select|Wrap|Line Numbers
  1. ul li:hover div {
  2.   left:0;
  3. }
  4.  
So it works nicely in Firefox ;) I have given up with IE and written some javascript. My problem is Opera! I'm testing on Opera 9 and when I hover over the li, the div appears but it isn't left:0 and it is 'broken' up - so bits are visible, bits aren't.

I have other menus on almost identical setups and they work in Opera9. The error consistently appears on the same sections though.

Some things I've thought about:

z-index - well this isn't a problem - fine in FF and other parts of the page
positioning on parent elements - I have looked at this and on changing the li from relative to static, the error is fixed BUT the div is not left:0 it's left:auto.
left:auto - i've tried this but the div ends up in the wrong place

Any other ideas / known bugs. I don't want to marginalise opera users ;)

Thanks in advance

Henry
Mar 20 '08 #1
2 3025
drhowarddrfine
7,435 Expert 4TB
They work the same to me in FF and Opera.
Mar 20 '08 #2
Paulson
63
Hi

Im not sure with Opera but I will try out but adding this code js file and adding in your code will help you for IE6

sfHover = function() {
// Support the standard nav without a class of nav.
var el = document.getElementById("nav");
if(!/\bnav\b/.test(el.className) && el.tagName == "UL")
setHover(el);

// Find all unordered lists.
var ieNavs = document.getElementsByTagName('ul');
for(i=0; i<ieNavs.length; i++) {
var ul = ieNavs[i];
// If they have a class of nav add the menu hover.
if(/\bnav\b/.test(ul.className))
setHover(ul);
}

}

function setHover(nav) {
var ieULs = nav.getElementsByTagName('ul');
if (navigator.appVersion.substr(22,3)!="5.0") {
// IE script to cover <select> elements with <iframe>s
for (j=0; j<ieULs.length; j++) {
var ieMat=document.createElement('iframe');
if(document.location.protocol == "https:")
ieMat.src="//0";
else if(window.opera != "undefined")
ieMat.src="";
else
ieMat.src="javascript:false";
ieMat.scrolling="no";
ieMat.frameBorder="0";
ieMat.style.width=ieULs[j].offsetWidth+"px";
ieMat.style.height=ieULs[j].offsetHeight+"px";
ieMat.style.zIndex="-1";
ieULs[j].insertBefore(ieMat, ieULs[j].childNodes[0]);
ieULs[j].style.zIndex="101";
}
// IE script to change class on mouseover
var ieLIs = nav.getElementsByTagName('li');
for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
// Add a sfhover class to the li.
ieLIs[i].onmouseover=function() {
if(!/\bsfhover\b/.test(this.className))
this.className+=" sfhover";
}
ieLIs[i].onmouseout=function() {
if(!this.contains(event.toElement))
this.className=this.className.replace(' sfhover', '');
}
}
} else {
// IE 5.0 doesn't support iframes so hide the select statements on hover and show on mouse out.
// IE script to change class on mouseover
var ieLIs = document.getElementById('nav').getElementsByTagNam e('li');
for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
ieLIs[i].onmouseover=function() {this.className+=" sfhover";hideSelects();}
ieLIs[i].onmouseout=function() {this.className=this.className.replace(' sfhover', '');showSelects()}
}
}
}

// If IE 5.0 hide and show the select statements.
function hideSelects(){
var oSelects=document.getElementsByTagName("select");
for(var i=0;i<oSelects.length;i++)
oSelects[i].className+=" hide";
}

function showSelects(){
var oSelects=document.getElementsByTagName("select");
for(var i=0;i<oSelects.length;i++)
oSelects[i].className=oSelects[i].className.replace(" hide","");
}

// Run this only for IE.
if (window.attachEvent) window.attachEvent('onload', sfHover);
// end

Other also I will try.
Regards Paulson C Paul.


Hello All

I have a 'flyout' css menu which uses something like this:

Expand|Select|Wrap|Line Numbers
  1. <ul>
  2.   <li><a>head</a><div style="position:absolute;left:-10000;"><ul><li>more</li><li>even more</li></ul></div></li>
  3.   <li><a>head</a><div style="position:absolute;left:-10000;"><ul><li>more</li><li>even more</li></ul></div></li>
  4. </ul>
  5.  
Expand|Select|Wrap|Line Numbers
  1. ul li:hover div {
  2.   left:0;
  3. }
  4.  
So it works nicely in Firefox ;) I have given up with IE and written some javascript. My problem is Opera! I'm testing on Opera 9 and when I hover over the li, the div appears but it isn't left:0 and it is 'broken' up - so bits are visible, bits aren't.

I have other menus on almost identical setups and they work in Opera9. The error consistently appears on the same sections though.

Some things I've thought about:

z-index - well this isn't a problem - fine in FF and other parts of the page
positioning on parent elements - I have looked at this and on changing the li from relative to static, the error is fixed BUT the div is not left:0 it's left:auto.
left:auto - i've tried this but the div ends up in the wrong place

Any other ideas / known bugs. I don't want to marginalise opera users ;)

Thanks in advance

Henry
Apr 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Thomas Mlynarczyk | last post by:
Hello, I want to style an <a> element to have a special padding on "hover", like a {padding: 3px 5px 2px 4px;} a:hover {padding: 2px 4px 3px 5px;} No problem for Mozilla. Opera 7, however,...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
11
by: Piers Lawson | last post by:
Hi Thank you to everyone who contributed to my last post (for those that noticed... I've now removed the XHTML ;-) In the page listed below, a two part horizontal menu is displayed, indented...
1
by: SeaPlusPlus | last post by:
I have a problem, with html and css that verifies, that my menus will not exhibit hover when the cursor is exactly to the left of the image centered on my web page. The problem shows up in...
15
by: Robert Mark Bram | last post by:
Hi All! Problem I began with: Netscape/Opera supports hover for different elements, IE only supports hover for <a> and I want to use hover for <td class="menu"> I then found a fix using some...
1
by: Richard | last post by:
A menu page has a set of A tages in a UL The menu (in IE) will only get the hover visualization if the mouse rolls over underlined text. I want it to happen if the rollover occurs anywhere in...
3
by: noize | last post by:
I have found other bugs related to using hover is CSS with IE, but I cannot find a fix for my issue. I have checked it in both IE 6 & 7 with the same results. I have built a drop-down menu using...
4
by: Sigilaea | last post by:
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...
8
by: Meri | last post by:
Hello Everybody on the internet seems to think this is a problem with IE but for me it works fine with IE, but the submenus do not appear with Firefox andOpera. The html is a simple list with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.