A slightly better working version:
jQuery(document).ready(function() {
   jQuery("[EMAIL PROTECTED]'sprite-hover-']").hover(
      function(){
jQuery(this).addClass( this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on') ); // jQuery(this).attr('class', this.className.replace(/sprite-hover-(\w+)-off/gi, 'sprite-hover-$1-on') );
      },
      function(){
jQuery(this).removeClass( this.className.match(/sprite-hover-(\w+)-on/gi) ); // jQuery(this).attr('class', this.className.replace(/sprite-hover-(\w+)-on/gi, 'sprite-hover-$1-off') );
      }
   );
});

This adds/removes a class. My guess is that replacing the entire class is causing the hover event to retrigger for some reason, whereas adding replacing classes does not.

 ~ ~ Dave

Reply via email to