Help me, please, to animate a tag using css data

Help me, please, to animate a tag using css data

Before, I am sorry for my (rus)English.

There is a task: to create animation on the basis of data of dynamically added styles table.
The decision received for evening:

  1.     //1 расширить до: получать массив из классов,
  2.     //2 флага удаления противоположного модификатора по БЭМУ
  3.     //3 рекурсивно выводить для всех вложенных классов которые он может затронуть
  4.     $.fn.animateClass = function (className, callback){

  5.         for(var StyleSheetList = document.styleSheets, i=0; i<StyleSheetList.length; i++){  
  6.             for(var cssRules=StyleSheetList[i].cssRules, j=0; j<cssRules.length; j++){   
  7.                 if(cssRules[j].selectorText==className){ 
  8.                     var cssText = cssRules[j].style.cssText; 
  9.                     cssText = cssText.replace(/\s/g,'');
  10.                     var cssAttributes = cssText.split(/[:;]/);
  11.                     var cssObject ={};   
  12.                     for(var k=0;k<cssAttributes.length;k+=2){
  13.                         if(!cssAttributes[k]){continue;} 
  14.                         cssObject[cssAttributes[k]]=cssAttributes[k+1];
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.         console.log(cssObject);
  20.         $(this).animate(cssObject,'slow',callback);
  21.         return this;
  22.     };
This function is super crude, I need simpler alternative which will be a cross-browser and complete.
ps: to obtain data from classes, not differently
tnx