9 replies [Last post]
rainkingcc
Offline
newbie
Last seen: 12 years 8 weeks ago
Joined: 2009-03-10
Posts: 6
Points: 0

I am having a weird issue where I think the hover should be working. However as you can see here:
http://www.triscaribeta.com/hd2/
It seems to only be working in Firefox not IE.
I'll appreciate any help I can get on this subject thanks!

The CSS

@charset "utf-8";
body {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #CCCCCC;
	background-image: url(../images/bgback.png);
	background-repeat: repeat-x;
	margin:0px;
	background-color:#141414;
	font-size:12px;
}
.back_front {
	background-image:url(../images/bgfront.png);
	position:relative;
	width:965px;
	height:548px;
	margin:0 auto;
	padding-right:20px;
	padding-left:20px;
	padding-top:155px;
}
.logo {
	position:absolute;
	width:258px;
	height:115px;
	background:url(../images/logo.png);
	left:20px;
	top:20px;
	z-index:2px;
}
.textnav {
	position:absolute;
	top:36px;
	left:298px;
	width:543px;
	;
	height:30px;
}
 
a:link {
  color: #f58026; 
  text-decoration: none; 
}
a:visited {
  color: #f58026; 
  text-decoration: none; 
}
a:hover { 
  color: #f58026; 
  text-decoration: underline; 
}
a:active {
  color: #f58026; 
  text-decoration: underline; 
}
 
.mainnav{
	position:absolute;
	top:66px;
	left:298px;
	width:auto;
}
.home_canvas {
	background-image:url(../images/homecanvas.png);
	width:964px;
	height:389px;
	position:relative;
}

The XHTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/home.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/nav_down_01.png')">
<div class="back_front">
<div class="logo"></div>
<div class="textnav">1-717-975-3348 | <a href="mailto:[email protected]">kevin@triscari.com</a> | <a href="contact/contact_us.php">Contact</a> | <a href="site-tools/FAQ.php">FAQ</a> | <a href="site-tools/site-map.php">Site Map</a> | <a href="site-tools/FAQ.php">Request A Proposal</a></div>
<div class="mainnav">
<a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','images/nav_down_01.png',1)"><img src="images/nav_up_01.png" alt="Home" name="Home" width="90" height="44" border="0" id="Home" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Services','','images/nav_down_02.png',1)"><img src="images/nav_up_02.png" alt="Services" name="Services" width="106" height="44" border="0" id="Services" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Videos','','images/nav_down_03.png',1)"><img src="images/nav_up_03.png" alt="Videos" name="Videos" width="131" height="44" border="0" id="Videos" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('AboutUs','','images/nav_down_04.png',1)"><img src="images/nav_up_04.png" alt="About Us" name="AboutUs" width="110" height="44" border="0" id="AboutUs" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('OurVision','','images/nav_down_05.png',1)"><img src="images/nav_up_05.png" alt="Our Vision" name="OurVision" width="125" height="44" border="0" id="OurVision" /></a><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Contact','','images/nav_down_06.png',1)"><img src="images/nav_up_06.png" alt="Contact" name="Contact" width="120" height="44" border="0" id="Contact" /></a></div>
<div class="home_canvas"></div>
</div>
</body>
</html>

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Take a look at

Take a look at this.
http://www.tutorio.com/media/css-tutorials/rollover-example.htm

And now you can get rid of all the giant unneeded javascript

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

rainkingcc
Offline
newbie
Last seen: 12 years 8 weeks ago
Joined: 2009-03-10
Posts: 6
Points: 0

Thanks

Thank you for your prompt reply Deuce! That is a great tutorial and I thank you for it. However the JavaScript in my code pertains to the image rollovers i have in the main nav. Unfortunately the issue I am having with IE is that in the text nav the a:hover is not working properly. Do you know why that may be?

Thanks Again!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

Replace your anchor styles

Replace your anchor styles with

a, a:visited {
  color: #f58026; 
  text-decoration: none; 
}
a:hover, a:active { 
  text-decoration: underline; 
}

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

rainkingcc
Offline
newbie
Last seen: 12 years 8 weeks ago
Joined: 2009-03-10
Posts: 6
Points: 0

Hmm

I have replaced the css with you suggestion. I certainly like how that is set up. I need to learn how to shorten all my code like that! Unfortunately a:hover is still not working in IE. Would it have something to do with the parent div being position:absolute?

Thanks again!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

possibly. Do you have a link?

possibly.
Do you have a link?

//EDIT\\ Or I could open my eyes I guess... :shrug:

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

You have a couple of CSS

You have a couple of CSS Error. Get those cleaned up.
http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fwww.triscaribeta.com%2Fhd2%2F

User the behavior in a conditional comment and z-index does not use px, em, % etc. Only numbers.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

rainkingcc

rainkingcc wrote:

Unfortunately the issue I am having with IE is that in the text nav the a:hover is not working properly.

Text nav at the very top works fine on IE6 and IE7 for me.
Not much I can test if I can't recreate the issue... maybe try clearing your cache?

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

rainkingcc
Offline
newbie
Last seen: 12 years 8 weeks ago
Joined: 2009-03-10
Posts: 6
Points: 0

IE 8 - Rut Roh?

I am beta testing IE 8 (windows 7 beta). I hope this isn't a issue that we can expect in the future. I just checked it in IE 7 and you're right! I was just thinking that if it doesn't work in in 8 it probably doesn't work in IE 7 (rookie mistake?).

Seriously though Deuce Thanks for all your help!

Deuce
Deuce's picture
Offline
Guru
Somewhere, USA
Last seen: 3 years 42 weeks ago
Somewhere, USA
Timezone: GMT-5
Joined: 2005-11-20
Posts: 4424
Points: 1843

rainkingcc wrote:I certainly

rainkingcc wrote:

I certainly like how that is set up.

DO some research on CSS Shorthand

As for IE8 - it's still beta, you can't trust it too much as they will continue to tweak and change it... you can use it as a point of reference, but not the end-all-be-all

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph