Advertisement
NecromancerCoding

Leyenda automática v3

Oct 2nd, 2021 (edited)
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.53 KB | None | 0 0
  1. $(document).ready(function(){
  2. $('.groups a').each(function(){
  3. var color = $(this).css('color');
  4. var name = $(this).text();
  5. var clase = $(this).text().replace(/\s/g, '').toLowerCase().replace(/'/g, "").replace(/\(|\)/g, "").slice(0,10);
  6. $(this).attr('style', '--group:'+color+';');
  7. $(this).parent('b').replaceWith(this);
  8. $(this).addClass('gr'+clase).removeClass('gensmall');
  9. $(this).attr('title', name);
  10. $(this).empty();
  11. });
  12.  
  13. $('.groups').each(function(){
  14. var content = $(this).children('a');
  15. $(this).html(content);
  16. });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement