Help with Rollovers
Posted: 30 July 2009 05:59 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2009-07-30

My current code is very simple, My links are text inside div tags which are placed over an image. I assign the div to the style sheet. Upon rollover of the image the style sheet makes the image invisible so that the background image is viable. Hence the rollover effect.

What i need is that when the link is the same as the current page being viewed the image behind the text will be the same as the rollover image and upon rollover, nothing will change.

So far i have asigned the Div tags an id and created some code to identify when the link is the same as the current page. My problem is that because of my method of rolling over i have no idea how to get my desired result.


Any help please? Below are 2 scripts. The first is the code i created to identify when the link is the same as the current page. The second code is my rollover efect script without the first script in it.

body#home a#home,
body#products a#prodnav,
body#faq a#faqnav,
body#contact a#connav {
backgroundurl(images/02.pngno-repeat;

 

 

 

 

 

<!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=iso-8859-1" />
<
style>
.
cssnav
{
position
relative;
font-familyBrowalliaUPC;
font-size25px;
backgroundurl(images/02.pngno-repeat;
white-spacenowrap;
displayblock;
width100;
height30;
margin0;
padding0;

}

.cssnav a
{
display
block;
color#000000;
font-size25px;
width211px;
height44px;
displayblock;
floatleft;
colorwhite;
text-decorationnone;
}

.cssnav img
{
width
100px;
height30px;
border0
}

html a:hover
{
visibility
:visible
}

.cssnav a:hover img
{
visibility
:hidden
}

.cssnav span
{
    position
absolute;
    
left: -1px;
    
top: -1px;
    
margin0px;
    
padding0px;
    
cursorpointer;
    
width100px;



</style>

<
title>Untitled Document</title>
</
head>

<
body id="home">

<
div class="cssnav">
<
a href="http://www.URL.com" id="home"><img src="images/01.png" alt="Alternative text" width="100" height="30" />
<
center>
  <
span>Home</span>
</
center></a></div

</
body>
</
html
Profile
 
 
Posted: 11 August 2009 05:53 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  19
Joined  2009-07-27

I suggest u to use dreamweaver , since it is more simpler than writing css. Moreover, dreamveaver provides u directly an option for image rollover, so the prog. part is done by the software itself.


Search engine optimization

Profile
 
 
Posted: 19 November 2009 01:04 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  5
Joined  2009-11-19

I would simply add a class to the anchor of the current page (the one you want to give the same effect as rollover) and change this:

.cssnav a:hover img
{
visibility
:hidden

to

.cssnav a:hover img, .cssnav a.youarehere img
{
visibility
:hidden
Profile