/    Sign up×
Community /Pin to ProfileBookmark

How to add a class with a fade in effect in jQuery?

Here is my code… any idea on why it aint working?

[CODE]$(document).ready(function(){
$(“#home_btn”).hover(
function(){
$(this).addClass(“grayBack”).fadeIn(“slow”);
}
);
}
);[/CODE]

I chained the action of adding a class with the fade in effect…did I do it wrong?

And here’s the HTML:

[code]<div class=”navigation”>
<ul class=”nav-list”>
<li id=”home_btn”>
HOME
</li>
<li id=”about_btn”>
ABOUT US
</li>
<li id=”team_btn”>
TEAM
</li>
<li id=”port_btn”>
PORTFOLIO
</li>
<li id=”propty_btn”>
<a href=”properties.php”>
PROPERTIES
</a>
</li>
<li id=”dwnld_btn”>
DOWNLOADS
</li>
<li id=”contact_btn”>
CONTACT US
</li>
</ul>
</div>[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@aditya2071990authorOct 22.2008 — I forgot to give the CSS:

<i>
</i>.navigation{
position:absolute;
}
.nav-list{
position:relative;
width:130px;
top:350px;
left:105px;
list-style-type:none;
font-family:"Segoe UI", Tahoma;
font-weight:520;
text-align:center;
font-size:1.2em;
z-index:1;
}
#home_btn{
padding-bottom:17px;
}
#about_btn{
padding-bottom:18px;
}
#team_btn{
padding-bottom:19px;
}
#port_btn{
padding-bottom:19px;
}
#propty_btn{
padding-bottom:17px;
}
#dwnld_btn{
padding-bottom:19px;
}
#contact_btn{
padding-bottom:19px;
}
.grayBack{
background-color:#999999;
}
Copy linkTweet thisAlerts:
@Jeff_MottOct 22.2008 — Hover takes two arguments. You only have one.

http://docs.jquery.com/Events/hover#overout
Copy linkTweet thisAlerts:
@aditya2071990authorOct 28.2008 — It seems that the thing got confused on what to do when the mouse hovers out, as I didn't specify that, and so it refused to execute the function...
×

Success!

Help @aditya2071990 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...