• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Jquery - 1 Button - 2 Events?


New Member
Hey Guys,

is it possible to have 2 Jquery events run on the same button?

for example I want my home page to fade to about 50% opacity when I click on #cat to open the navigation menu, but I also want to bring the opacity back to 100% if I were to click on #cat again? or any of the other nav buttons.

I tried;

$('#cat').click(function() {
$('.homepage,').fadeTo(500, 0.5);
return false;

$('#cat').click(function() {
$('.homepage,').fadeTo(500, 1.0);
return false;

It changes it to 50% but then instantly changes back to 100% so I'm thinking this is a little more complicated then I can do right now, so any help would be great!

I have read about .bind and .one but I'm not sure.....still an amateur:D