hover and active states on button/img

hover and active states on button/img

I'm trying to add an active state on my imgs/buttons. I have a hover effect as follows:

  1. $(document).ready(function(){   
  2. $(".folio,.services,.contact,.about").fadeTo("fast",0.5);
  3. $(".folio,.services,.contact,.about").hover(
  4.         function() {$(this).fadeTo("fast",1);},
  5.         function() {$(this).fadeTo("fast",0.5);});
  6. $(".folio,.services,.contact,.about").click(function(){
  7. if($(".active").length) {
  8. $(".active").removeClass("active");
  9. $(this).addClass("active");
  10. } else {
  11. $(this).addClass("active")};});
  12. $(".active").fadeTo("fast",1);
  13. });

The hover works, and so does the "active" on/off, but not the opacity setting on the "active" class.

Any ideas? TIA.