Page 1 of 1
Hover effect not working
Posted: Thu Sep 16, 2004 8:04 am
by ljCharlie
Okay here's what I have.
On my CSS file I have this:
Code: Select all
A:link { color: #000066; text-decoration: underline; }
A:visited { color: #000066; text-decoration: underline; }
A:hover { color: #990000; text-decoration: underline; }
A:active { color: #000066; text-decoration: underline; }
A.subMenu:link { color: #FFFFFF; text-decoration: underline; }
A.subMenu:visited { color: #000066; text-decoration: underline; }
A.subMenu:hover { color: #FFFFFF; text-decoration: underline; }
A.subMenu:active { color: #990000; text-decoration: underline; }
Then on the body I used it this way:
Code: Select all
<?
echo "<a href=$self?sectionID=$sectID class='subMenu'>".$dscription."</a>";
?>
And it is not working. Any help is appreciated.
ljCharlie
Posted: Thu Sep 16, 2004 8:14 am
by dethron
Code: Select all
<?php
echo "<a href="$self?sectionID=$sectID" class="subMenu">".$dscription."</a>";
?>
Posted: Thu Sep 16, 2004 8:15 am
by dethron
and be sure $dscription is not null, if so it wont be visible to us.
Posted: Thu Sep 16, 2004 8:20 am
by m3mn0n
Moved to Client Side.
Is $dscription supose to be that way? Sure it's not $description?
Posted: Thu Sep 16, 2004 8:52 am
by ljCharlie
Many thanks for the help but still not working as I expected. Noticed that the submenu.hover color is different from the regular a.hover color. And if I specify the class in the <a href="#" class="submenu">home</a> I expect the color #FFFFFF to appear when the mouse is over the text "home". In the suggestion above, the color #FFFFFF doesn't show up when hovering over the texts, instead the color a.hover, which is #990000, shows up. I want to apply different hover color to different text menu.
ljCharlie
Posted: Thu Sep 16, 2004 9:01 am
by dethron
actually it is working as supposed to be...do not confused with link,visited,hover,active
change the $dscription to make link not visited.
it is a very simple thing, may be u need some rest

Posted: Thu Sep 16, 2004 9:15 am
by ljCharlie
I noticed something. If I use IE, nothing is working. The texts are all white. However, if I use Mozilla Firefox, the a.hover color, #990000, shows up instead of the submenu.hover color of white, #FFFFFF.
What's going on? Is it a browser problem?
What I wanted is, if it is simply a hyper texts link then I want the a.hover color of #990000 to show when mouse over as stated in the CSS file. However, when I specified the class to "submenu" I want the sumenu.hover of white, #FFFFFF to show up whem mouse over as is in the CSS file. But it's not doing this.
Here's the page
http://www.uwstout.edu/alumni/alumnPhot ... n=archived
And here is the body tag that generates the menu texts.
Code: Select all
<?
if ($btnClicked == "archived"){
$numOfCells=1;
$bgColor = "#05A1C4";
$totoRows_rsRecords = $totalRows_rsArchived;
$rsRecords = $rsArchived;
}
elseif ($btnClicked == "current"){
$numOfCells=1;
$bgColor = "#51af7b";
$totoRows_rsRecords = $totalRows_rsCurrent;
$rsRecords = $rsCurrent;
}
if ($totoRows_rsRecords >0){
if ($numOfCells ==1){
echo "<br>";
echo '<table width="620" border="0" cellpadding="0" cellspacing="0" bgcolor="'.$bgColor.'">';
$numOfRows = 1;
$numCellsFilled = 1;
}
while($row_rsRecords = mysql_fetch_assoc($rsRecords)){
if ($numOfRows == 1){
echo '<tr class="bodycopy">';
$numOfRows = 0;
}
$dscription = $row_rsRecords["description"];
$sectID = $row_rsRecords["sectionID"];
if ($numCellsFilled <= 2){
echo "<td width='206' align='center'><a href=$self?sectionID=$sectID class='submenu'>".$dscription."</a></td>";
echo '<td width="1">|</td>';
$numCellsFilled++;
}
elseif($numCellsFilled ==3){
echo "<td width='206' align='center'><a href=$self?sectionID=$sectID class='submenu'>".$dscription."</a></td>";
echo '</tr>';
$numCellsFilled = 1;
$numOfRows = 1;
}
}
echo '</table>';
}
?>
ljCharlie
Posted: Thu Sep 16, 2004 9:26 am
by ljCharlie
I got something working now. It is the color of the link and hover that are the same that is why it's not working. It's now working under IE but it's not working in Mozilla browser. Any guess on this?
ljCharlie
Posted: Thu Sep 16, 2004 9:59 am
by dethron
hmm, yes you are right.
sorry but it is visual-stuff, (i hate it)
i hope following link will be helpfull for you.
http://www.w3schools.com/css/css_pseudo_classes.asp
Posted: Fri Sep 17, 2004 6:41 am
by zenabi
Looking at your HTML source, your links still show up without the quotes:
Code: Select all
<a href=/alumni/alumnPhotoGallery.php?sectionID=1 class='submenu'>Appleton Gathering</a>
It should be:
Code: Select all
<a href='/alumni/alumnPhotoGallery.php?sectionID=1' class='submenu'>Appleton Gathering</a>
Notice the quotes around the URL.
Posted: Fri Sep 17, 2004 2:45 pm
by d3ad1ysp0rk
Code: Select all
A:link { color: #000066; text-decoration: underline; }
A:visited { color: #000066; text-decoration: underline; }
A:hover { color: #990000; text-decoration: underline; }
A:active { color: #000066; text-decoration: underline; }
.subMenu a:link { color: #FFFFFF; text-decoration: underline; }
.subMenu a:visited { color: #000066; text-decoration: underline; }
.subMenu a:hover { color: #FFFFFF; text-decoration: underline; }
.subMenu a:active { color: #990000; text-decoration: underline; }