[RESOLVED] Right-Click Menu Issue, Want CSS answer NOT Javascript
While I am willing to use Javascript, I REALLY want to use CSS.
Now... On to my issue.
I have created a little Right-Click Menu, it is available Here (Click the link at the bottom of the page.)
Here's the problem: The CSS hover effect works well, when I hover over a blank part of the menu background. However, when I put my mouse over the text that is "on top" of the menu background, the menu CSS hover effect is deactivated because I have my mouse over a different element.
I am aware that there is not any CSS parent selector (this is true right?), but am sure there must be a creative way to solve this.
Any Ideas? Here's the full code. (note that it differs from the code found on the online example because the Javascript is included here. In the online example, the javascript is an external file.
I've read your description, visited your page and clicked the link at the bottom, but I still have no idea what the problem is and what you want to achieve. A right-click menu? What is that? A menu that appears when one clicks it with the right mouse button? And that's just for starters.
This probably won't directly answer the question as asked, but i think you're crazy to be using that kind of markup anyway. All those empty div's just give IE7 and 8 rounded corners......stop being silly. Use the border-radius property and leave IE7/8 users without rounded corners. That way, you're markup then becomes infinitely cleaner:
Code:
<ul id="mymenu">
<li><a href="#">My Menu Item</a></li>
</ul>
I've switched careers...
I'm NO LONGER a scientist,
but now a web developer...
awesome.
Thankyou for the helpful replies.
I have solved the problem. I have used a semi-css semi-javascript solution to the problem, making javascript load a css class onmouseover.\
Code:
if(rantBecauseOf('aj_nsc') == true) {
Oh, and the corners are from a image file. The divs have a background image. Once you get into positioning, gradient, transparency, AND rounded corners, you have so many browser compatibility issues that you might as well throw away firefox, opera, IE, and keep only Chrome. OH WAIT... I forgot. I cant do that because chrome only has 28% of the browser share. I just lost by other 72% of my users.
BUT - I could include a buttload of CSS each line allowing for part compatibility with 1 more browser! Now, congratulations, I have 400 lines of CSS instead of 200. How will that affect loading time? Hm? DID YOU KNOW THERE ARE STILL PEOPLE USING DIAL-UP!?! Come on, people.
Now we've got another browser to worry about. It's IE9. Finally catching onto the whole simple-slick user interface, but not web standards! WHO DO THEY THINK THEY ARE? Thank God their not W3C. It's like the new IE6. Because when IE10 comes out, they're gonna fix all of the kinks in IE9 (I hope) ... (OR DO I?)... because when they fix all of the kinks, the kinks are still gonna be in IE9.
Code:
//AW MAN!
This means I will need to add compatibility for another browser. Speaking of IE6, did you know that a whopping 2.3% of people still use IE6. Wait... that's not very big. Nevermind.
OR...
I could just add 3 divs and an image background. CAN YOU HANDLE THAT? THREE DIVS.
Code:
if(document.THREEDIVS.length > 3) {
CAN'T HANDLE.
Code:
} else {
alert("WHAT's YOUR PROBLEM?\n\nIf you have a proble, click OK or close this");
document.you.eatFace = true;
CAN HANDLE.
Code:
}
I think you can handle that.
Code:
document.LESSON = "Don't EVER get me started on compatibility issues. I hate how things are being handled by web browsers.";
return false;
} else {
A menu that appears when one clicks it with the right mouse button?
I now see that it indeed is just that, having opened the page in IE(8). And I must say, that might come in handy. A pity however, that it doesn't work in FF.
Did you try other forums, that of javascript or PHP specialists? Maybe they know a work-around so that it does work in FF, too? (PHP specialists generally know a lot about javascript as well.)
Bookmarks