>From what I see all your image links do exact same shift of background
image on hover and active. You used a different class for each link to
assign indiividual background images, however you don't need to create
a new class for each link just to shift the background since they all
shift same amount. You can chain CSS similar to chaining jQuery also. CSS: #cs_links a:hover, .active {background-position: -146px;} //this one rule will replace the 11 rules you are going to create ( one for each link and one for active) JS: //inside document.ready $("#cs_links a".click(function() { $(".active").removeClass("active"); $(this).addClass("active"); return false; }); Erik R. Peterson wrote:
|
- [jQuery] <a>, hover & active Erik R. Peterson
- [jQuery] Re: <a>, hover & active waseem sabjee
- [jQuery] Re: <a>, hover & active Erik R. Peterson
- [jQuery] Re: <a>, hover & active waseem sabjee
- [jQuery] Re: <a>, hover & acti... Erik R. Peterson
- [jQuery] Re: <a>, hover &... Charlie
- [jQuery] Re: <a>, hover &... Charlie
- [jQuery] Re: <a>, hov... Erik R. Peterson
- [jQuery] Re: <a>, hov... Charlie
- [jQuery] Re: <a>, hov... Erik R. Peterson
- [jQuery] Re: <a>, hov... Charlie
- [jQuery] Re: <a>, hov... Erik R. Peterson
- [jQuery] Re: <a>, hover & active Abrar Arshad