The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Making nav bar changed when rolledover?

4 posters

Go down

Solved Making nav bar changed when rolledover?

Post by Agent24 18/5/2010, 01:37

how do you make the nav bar so when you roll your mouse over it, it changes to something different? An examlpe is on this forum. when you roll over "Home" button it changes from blue to orange.


Last edited by Agent24 on 4/6/2010, 17:20; edited 1 time in total
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by AlphaPkz 18/5/2010, 04:24

I believe you need to edit your CSS
AlphaPkz
AlphaPkz
Forumember

Male Posts : 251
Reputation : 0
Language : English | Cantonese | Mandarin

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 18/5/2010, 04:57

AlphaPkz wrote:I believe you need to edit your CSS
do you know what i need to put?
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 19/5/2010, 04:16

bump
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 20/5/2010, 04:08

bump...
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 21/5/2010, 06:43

bump..........
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by harvengure 21/5/2010, 07:36

While I do not approve of simply giving you the code as I've seen nothing to indicate you'd either understand or have attempted to find it yourself, this forum is about helping others so I will simply give you a couple of examples.

Without knowing the forum version you are using I am forced to be vague but for a css roll-over menu you would use html such as the following:
Code:

<div id="main-nav">
   <ul>
      <li><a href="#" class="home"><span>Home</span></a></li>
      <li><a href="#" class="about"><span>About us</span></a></li>
      <li><a href="#" class="faq"><span>F.A.Q.</span></a></li>
      <li><a href="#" class="contact"><span>Contact</span></a></li>
   </ul>
</div>
And then style it with the following CSS placed in the head section of your html:
Code:

<style type="text/css">
#main-nav{
   width:400px;
   height:50px;
   margin:0 auto;
   background:#acacac url(img/menu-bg.jpg) no-repeat;             
}


#main-nav ul{
   border: 0;
   margin: 0;
   padding: 0;
   list-style-type: none;
   text-align: center;
   clear: left;
}

#main-nav ul li{
   display: block;
   float: left;
   text-align: center;
   padding: 0;
   margin: 0;
}

#main-nav ul li a span{
   display:none;
}


#main-nav ul li a{
   width:100px;
   height:50px;
   margin:0px;
   padding:0px;
   display: block;
      
}

/* -- Hovers -- */

#main-nav ul li a.home:hover{
   background: url(img/menu-bg.jpg) 0px -50px;
}

#main-nav ul li a.about:hover{
   background: url(img/menu-bg.jpg) -100px -50px;
}
#main-nav ul li a.faq:hover{
   background: url(img/menu-bg.jpg) -200px -50px;
}         
#main-nav ul li a.contact:hover{
   background: url(img/menu-bg.jpg) -300px -50px;
}      
</style>
While if you wish and have the patients to use jQuery, someone has a very good tutorial on your desired result here.
avatar
harvengure
Forumember

Posts : 86
Reputation : 0
Language : English

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 22/5/2010, 04:36

harvengure wrote:While I do not approve of simply giving you the code as I've seen nothing to indicate you'd either understand or have attempted to find it yourself, this forum is about helping others so I will simply give you a couple of examples.

Without knowing the forum version you are using I am forced to be vague but for a css roll-over menu you would use html such as the following:
Code:

<div id="main-nav">
   <ul>
      <li><a href="#" class="home"><span>Home</span></a></li>
      <li><a href="#" class="about"><span>About us</span></a></li>
      <li><a href="#" class="faq"><span>F.A.Q.</span></a></li>
      <li><a href="#" class="contact"><span>Contact</span></a></li>
   </ul>
</div>
And then style it with the following CSS placed in the head section of your html:
Code:

<style type="text/css">
#main-nav{
   width:400px;
   height:50px;
   margin:0 auto;
   background:#acacac url(img/menu-bg.jpg) no-repeat;             
}


#main-nav ul{
   border: 0;
   margin: 0;
   padding: 0;
   list-style-type: none;
   text-align: center;
   clear: left;
}

#main-nav ul li{
   display: block;
   float: left;
   text-align: center;
   padding: 0;
   margin: 0;
}

#main-nav ul li a span{
   display:none;
}


#main-nav ul li a{
   width:100px;
   height:50px;
   margin:0px;
   padding:0px;
   display: block;
      
}

/* -- Hovers -- */

#main-nav ul li a.home:hover{
   background: url(img/menu-bg.jpg) 0px -50px;
}

#main-nav ul li a.about:hover{
   background: url(img/menu-bg.jpg) -100px -50px;
}
#main-nav ul li a.faq:hover{
   background: url(img/menu-bg.jpg) -200px -50px;
}         
#main-nav ul li a.contact:hover{
   background: url(img/menu-bg.jpg) -300px -50px;
}      
</style>
While if you wish and have the patients to use jQuery, someone has a very good tutorial on your desired result here.

i have researched it and i found one code but when i insert it, nothing happens
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by harvengure 4/6/2010, 12:51

Did the code I gave you work?
avatar
harvengure
Forumember

Posts : 86
Reputation : 0
Language : English

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by Agent24 4/6/2010, 17:19

Yes it did thanks Smile
I forgot to mark this solved
Solved
Agent24
Agent24
Forumember

Male Posts : 813
Reputation : 72
Language : English, Spanish
Location : California

Back to top Go down

Solved Re: Making nav bar changed when rolledover?

Post by RoNo 4/6/2010, 21:16


As stated by the author, this topic is solved.
Making nav bar changed when rolledover? Locked1Making nav bar changed when rolledover? Lock2
RoNo
RoNo
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum