NecromancerCoding

Avatares en notificaciones

Jul 23rd, 2026
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.59 KB | None | 0 0
  1. $(window).on('load', function(){
  2.  
  3. const avatarNotiClase = 'contentAvatar';
  4. const avatarNotiPrependTo = '.content';
  5. const avatarPerfil = '.psavatar';
  6.  
  7. $('#fa_notifications').on('click', function(){
  8. $('#notif_list>li:has(.contentText a>.usr_grp_clr):not(:has(.'+avatarNotiClase+'))').each(function(){
  9. var $target = $(this).find(avatarNotiPrependTo);
  10. var link = $(this).find('.contentText .usr_grp_clr').parent('a').attr('href');
  11. $.get(link, function(data){
  12. var avatar = $(data).find(avatarPerfil).html();
  13. $target.prepend('<div class="'+avatarNotiClase+'">'+avatar+'</div>');
  14. });
  15. });
  16. });
  17.  
  18. });
Advertisement
Add Comment
Please, Sign In to add comment