Reputation: 13
Well I'm trying to make jQuery edit my body when a link is clicked. So far, all that it does is make the Link Fade but background wont change on the I don't understand why, maybe you guys can help with that.
<div id="navbar_wrapper">
<div id="nav_title">
Kitty <small> "<? echo $information[array_rand($information)]; ?>" </small>
</div>
<div id="nav_links">
<a href="#">Home</a>
<a href="#">Information</a>
<a href="#">Contact</a>
<a href="#" id="activate">Download</a>
</div>
</div>
<script type="text/javascript">
$('#activate').click(function(){
$(this).fadeOut()
$('body').css('background: red;')
});
</script>
Upvotes: 0
Views: 252
Reputation: 74738
change to this:
$('body').css('background', 'red')
if you want to do then you can choose this in the callback function in the fadout()
$(this).fadeOut('slow', function(){
$('body').css('background', 'red');
});
Upvotes: 3