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:
- $(document).ready(function(){
- $(".folio,.services,.contact,.about").fadeTo("fast",0.5);
- $(".folio,.services,.contact,.about").hover(
- function() {$(this).fadeTo("fast",1);},
- function() {$(this).fadeTo("fast",0.5);});
- $(".folio,.services,.contact,.about").click(function(){
- if($(".active").length) {
- $(".active").removeClass("active");
- $(this).addClass("active");
- } else {
- $(this).addClass("active")};});
- $(".active").fadeTo("fast",1);
- });
The hover works, and so does the "active" on/off, but not the opacity setting on the "active" class.
Any ideas? TIA.