Glen Lipka wrote:
Do you have a page that has the example?
If you mean an example of the flickering problem, then I'll put one up.

Also, I use jQuery with sprites in multiple methods here. Some use a very powerful matrix approach, which has really clean CSS.
We considered the matrix idea, but in this case the images are all different sizes. Even after grouping common sizes in their own sprites, we ended up with more sprites than was worth the effort.


In the meantime, I this seems to work. It makes various assumptions regarding class positioning, but that can be corrected.

jQuery(document).ready(function() {
   jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
      function(){
         var x=this.className.split(' ');
         jQuery(this).addClass(x[x.length-1].replace('-off','-on'));
if (this.className == '') this.className = x[0].replace('-off','-on');
      },
      function(){
         var x=this.className.split(' ');
         jQuery(this).removeClass(x[x.length-1]);
if (this.className == '') this.className = x[0].replace('-on','-off');
      }
   );
});

Reply via email to