TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-27-2007, 02:10 AM   #1 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default Menu Display Problem in IE6+

I've implemented the AnyLink menu that's on DynamicDrive, but have made some minor changes to fit the design. Everything looks solid in FF, Opera and Safari. However, the devil (IE) has a problem displaying the menu at the top.

When I hover over a menu button, a dropdown selection menu appears. It shows up in IE properly except for the fact that it's behind the content divs! I assumed I could fix this by adding some z-index values to the coding for the content and menu divs, but it did not help and I continue to have the display issue in IE.

I would appreciate any help/suggestions on this. I'm just at a dead-end with it up to this point.

See the site live: The Winter Series - News

CSS for the menu area. Excuse the sloppiness, I'll clean it up later:
Code:
#ja-mainnav { position: relative; background-image: url(xx/xx/xx.jpg); height: 184px; }
#ja-mainnav div {
	z-index: 3000;
	width: 110px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #003366;
	text-indent: 2px;
	text-align: left;
	padding: 4px;
	background-color: #C8D7D3;
	border-left: 1px solid #333333;
	border-top: 1px solid #333333;
	border-right: 1px solid #333333;
	border-bottom: 1px solid #333333;
	visibility: hidden;
	display: table;
	 }
#ja-mainnav div a {
	border: 0px;
	display: block;
	text-decoration: none;
	color: #003366;
}
#ja-mainnav div a:hover {
	background-color: #003366;
	color: #ffffff;
	text-indent: 2px;
}

#anylinkmenu1 { position: absolute; left: 426px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu2 { position: absolute; left: 490px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu3 { position: absolute; left: 550px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu4 { position: absolute; left: 625px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu5 { position: absolute; left: 695px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }

#ja-mainnav a.anylinkmenu1 { position: absolute; left: 416px; top: 148px; width: 55px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu2 { position: absolute; left: 481px; top: 148px; width: 50px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu3 { position: absolute; left: 541px; top: 148px; width: 64px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu4 { position: absolute; left: 615px; top: 148px; width: 65px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu5 { position: absolute; left: 690px; top: 148px; width: 75px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
obolus is offline  
Reply With Quote
Old 12-27-2007, 02:18 PM   #2 (permalink)
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 104
Thanks: 9
sjaq is on a distinguished road
Default

z-index only works when you define a position, so try this:

Code:
#ja-mainnav { position: relative; background-image: url(xx/xx/xx.jpg); height: 184px; }
#ja-mainnav div {
	position: relative;
	z-index: 3000;
	width: 110px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #003366;
	text-indent: 2px;
	text-align: left;
	padding: 4px;
	background-color: #C8D7D3;
	border-left: 1px solid #333333;
	border-top: 1px solid #333333;
	border-right: 1px solid #333333;
	border-bottom: 1px solid #333333;
	visibility: hidden;
	display: table;
	 }
#ja-mainnav div a {
	border: 0px;
	display: block;
	text-decoration: none;
	color: #003366;
}
#ja-mainnav div a:hover {
	background-color: #003366;
	color: #ffffff;
	text-indent: 2px;
}

#anylinkmenu1 { position: absolute; left: 426px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu2 { position: absolute; left: 490px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu3 { position: absolute; left: 550px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu4 { position: absolute; left: 625px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu5 { position: absolute; left: 695px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }

#ja-mainnav a.anylinkmenu1 { position: absolute; left: 416px; top: 148px; width: 55px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu2 { position: absolute; left: 481px; top: 148px; width: 50px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu3 { position: absolute; left: 541px; top: 148px; width: 64px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu4 { position: absolute; left: 615px; top: 148px; width: 65px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu5 { position: absolute; left: 690px; top: 148px; width: 75px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
(btw. your css is a mess! )
sjaq is offline  
Reply With Quote
The Following User Says Thank You to sjaq For This Useful Post:
obolus (12-27-2007)
Old 12-27-2007, 06:34 PM   #3 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

Doh! I didn't even think about that.

Yea, sorry for the messy css. Thanks for the reply!
obolus is offline  
Reply With Quote
Old 12-27-2007, 07:07 PM   #4 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

Hmm.. didn't fix the problem, but it has maybe put me in the right direction. =)
obolus is offline  
Reply With Quote
Old 12-27-2007, 07:52 PM   #5 (permalink)
The Wanderer
 
Join Date: Dec 2007
Location: The Netherlands
Posts: 13
Thanks: 3
Jelmer is on a distinguished road
Default

I don't know about the problem, but you can clean up your css a lot, for example you can replace this:

Code:
border-left: 1px solid #333333;
border-top: 1px solid #333333;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
with this:
Code:
border: 1px solid #333333;
if you want different border sizes on each side:
Code:
border: 1px 2px 0 4px solid #ccc;
(clockwise from top, so border-top is 1px, border left is 4px)

You can also combine the fonts stuff in one line:
font: 1.1em arial, sans-serif;

And finally you can lose a lot of code for the menu items, first define the things that are the same in one piece of code like this:
Code:
#anylinkmenu1, #anylinkmenu2, #anylinkmenu3
{
insert same code..
}

#anylinkmenu1{insert specific code}
I guess it might not be that relevant now but it might just improve your css skills a bit..

I had a look in IE and I see what's wrong now, but besides being behind those div's, I can't click on the links in IE either so that's another potential issue.. Are you sure this is caused (and can therefore be fixed) with css? Is there any javascript involved?
Jelmer is offline  
Reply With Quote
The Following User Says Thank You to Jelmer For This Useful Post:
obolus (12-27-2007)
Old 12-27-2007, 08:28 PM   #6 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

Yea, there's some javascript in involved with the menu.

Code:
var menubgcolor='#000000'  //menu bgcolor
var disappeardelay=500  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all
var vismenus = new Array();
var dropmenuobj;
var delayhide;

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden){
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function dropdownmenu(obj, e, menucontents){
hidemenu();
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById(menucontents) : dropmenudiv

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden")
}

vismenus.push(dropmenuobj);

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
var len = vismenus.length;
for (i = 0; i < len; i++) {
dropmenuobj = vismenus.pop();
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
The variables at the top don't affect the menu since the css controls its style properties.
obolus is offline  
Reply With Quote
Old 01-05-2008, 03:53 AM   #7 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

I give up on trying to fix this issue.

*sends hatemail to microsuck*
obolus is offline  
Reply With Quote
Old 01-09-2008, 06:03 AM   #8 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

Sd@*&%*%#@@!!!!!!!!!!!!!
obolus is offline  
Reply With Quote
Old 01-09-2008, 01:44 PM   #9 (permalink)
The Contributor
 
Join Date: Apr 2005
Posts: 29
Thanks: 0
Dr John is on a distinguished road
Default

Why don't you just replace it with the son of suckerfish menu? That works very well. Suckerfish sometimes need this line in the css to solve a similar problem to what you have had however. li:hover{visibility:visible}
__________________
www.kidneydialysis.org.uk
Dr John is offline  
Reply With Quote
Old 01-09-2008, 04:03 PM   #10 (permalink)
The Gregarious
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 594
Thanks: 15
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by obolus View Post
Sd@*&%*%#@@!!!!!!!!!!!!!
__________________
There are two ways to write bug-free code, only the third one works.
Village Idiot is offline  
Reply With Quote
The Following 2 Users Say Thank You to Village Idiot For This Useful Post:
obolus (01-10-2008), sketchMedia (01-09-2008)
Old 01-09-2008, 06:23 PM   #11 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

lol @ piechart

The reason I didn't want to switch menu setups is because the site (designed by me, coded by someone else) is hard-coded. Perhaps if I posted the code, it'd give you a better idea of what I mean by that. =)

Anyway, someone that helped with the site fixed the issue this morning. IE apparently has issues with Z-index settings.
obolus is offline  
Reply With Quote
Old 01-09-2008, 06:23 PM   #12 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

btw thanks all =)
obolus is offline  
Reply With Quote
Old 01-09-2008, 07:36 PM   #13 (permalink)
The Frequenter
Advanced Programmer Top Contributor Good Samaritan 
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 469
Thanks: 26
sketchMedia is on a distinguished road
Default

hahaha that pie chart is pretty much bang on target.
__________________
sketchMedia is offline  
Reply With Quote
Old 02-29-2008, 02:54 PM   #14 (permalink)
The Visitor
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
nishant_sebastian is on a distinguished road
Default

Hi Obolus,

I am also facing the similar problem for IE. that the menu is behind the content. Could you tell me what was the fix for this. Some thing with Z-Index?
Nishant

---------------------------------
Quote:
Originally Posted by obolus View Post
lol @ piechart

The reason I didn't want to switch menu setups is because the site (designed by me, coded by someone else) is hard-coded. Perhaps if I posted the code, it'd give you a better idea of what I mean by that. =)

Anyway, someone that helped with the site fixed the issue this morning. IE apparently has issues with Z-index settings.
nishant_sebastian is offline  
Reply With Quote
Old 03-01-2008, 07:57 PM   #15 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

Here is the updated CSS, sebastian. It's still messy as hell. =(

There are changes in z-index values (just compare to my first post).

Code:
#ja-mainnav { position: relative; background-image: url(../images/s_header.jpg); height: 184px;z-index: 3000; }
#ja-mainnav div {
	z-index: 3000;
	width: 110px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #003366;
	text-indent: 2px;
	text-align: left;
	padding: 4px;
	background-color: #C8D7D3;
	border-left: 1px solid #333333;
	border-top: 1px solid #333333;
	border-right: 1px solid #333333;
	border-bottom: 1px solid #333333;
	visibility: hidden;
	display: table;
	 }
#ja-mainnav div a {
	border: 0px;
	display: block;
	text-decoration: none;
	color: #003366;
}
#ja-mainnav div a:hover {
	background-color: #003366;
	color: #ffffff;
	text-indent: 2px;
}

#anylinkmenu1 { position: absolute; left: 426px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu2 { position: absolute; left: 490px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu3 { position: absolute; left: 550px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu4 { position: absolute; left: 625px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }
#anylinkmenu5 { position: absolute; left: 695px; top: 180px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; line-height: 16px; z-index: 100; width: 40px; border: 1px outset #000000; background-color: #CCCCCC; color: #000000; }

#ja-mainnav a.anylinkmenu1 { position: absolute; left: 416px; top: 148px; width: 55px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu2 { position: absolute; left: 481px; top: 148px; width: 50px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu3 { position: absolute; left: 541px; top: 148px; width: 64px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu4 { position: absolute; left: 615px; top: 148px; width: 65px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
#ja-mainnav a.anylinkmenu5 { position: absolute; left: 690px; top: 148px; width: 75px; height: 32px; display: block; padding: 4px 0; text-decoration: none; font-weight: bold; text-indent: 5px; font-family: Arial, Helvetica, sans-serif; font-size: 9px; color: #000000; text-align: left; }
obolus is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:05 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0