jquery css change

So i have some spans that when i rollover one of them i want to change the font of that particular one do a different color, so i am thinking that i can just change the css close, but i dont know how to in Jquery assign a new css class to the current affected interacting item.  In other words there are multiple spans with the .tab_item class, i just wont to change the one that i am over, and have it reset when im off it.
<script>
$(document).ready(function()
{
  $(".tab_item").mouseover(function()
  {


  });
  $(".tab_item").mouseout(function()
  {


  });

});
</script>
<style>
.tabs .tab_item {
	display: block;
	float: left;
	padding-top:34px;
	width: 160px;
	
	text-align: center;
	z-index: 200;
	position: relative;
	cursor: pointer;
	font-size:16px;
	font-family:Arial;
	color:#ffffff;
}
</style>

<span class='tab_item'>
Our Company!
</span>
<span class='tab_item'>
Information
</span>
<span class='tab_item'>
Contact Us
</span>

Open in new window

LVL 4
Brant SnowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Hello thawts,

i.e : $(this).css("color", "#888888");

Check this :

<!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" />
<style>
.tabs .tab_item {
        display: block;
        float: left;
        padding-top:34px;
        width: 160px;
        
        text-align: center;
        z-index: 200;
        position: relative;
        cursor: pointer;
        font-size:16px;
        font-family:Arial;
        color:#ffffff;
}
</style>
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script language="javascript">
	$(document).ready(function() {
		$(".tab_item").mouseover(function() {
			$(this).css("color", "#888888");
		});
		$(".tab_item").mouseout(function() {
			$(this).css("color", "#000000");
		});
	});
</script>
</head>
<body>
<span class='tab_item'>
Our Company!
</span>
<span class='tab_item'>
Information
</span>
<span class='tab_item'>
Contact Us
</span></script>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KrileCommented:
You could go with the .hover() and .toggleClass() methods in jquery.

.hover() is nice because it compacts the mouseover and mouseout functions into one.

.toggleClass is nice because you can conditionally add a function inside the toggle class to inspect the current thing you want to toggle and decide what class to toggle.

You can read more about toggleClass here:

http://api.jquery.com/toggleClass/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Untitled Document</title>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
		<style>
			div.hover {font-size: 12px;cursor:pointer;}
			div.hover_on {font-size: 18px;background:yellow;}
		</style>
		<script type="text/javascript">

		$(function(){
			$("div.hover").hover(
				//mouseover function
				function(){
					$(this).toggleClass("hover_on");
				},
				//mouseout function
				function(){
					$(this).toggleClass("hover_on");
				}

			);
		})
		</script>
	</head>
	<body>
		<div class="hover">
			This is a smaller text to start...but bigger when hovering.
    	</div>
	</body>
</html>

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.