Advertisement
NecromancerCoding

Avatar en Últimos temas (JS)

Oct 28th, 2024 (edited)
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.58 KB | None | 0 0
  1. $(function(){
  2.  
  3. var avatarProfile = '.psavatar'; /*Pon aquí la clase que contiene tu avatar en el perfil sencillo*/
  4.  
  5. /*No edites a partir de aquí*/
  6. $('.tbt-user').each(function(){
  7. var avatar = $(this).parents('.tbtopic').find('.tbtavatar');
  8. var link = $(this).find('a[href^="/u"]').attr('href');
  9. $.get(link, function(data) {
  10. var useravatar = $(data).find(avatarProfile+' img');
  11. $(avatar).append(useravatar);
  12. });
  13. });
  14. $('.tbt-invi').each(function(){
  15. var avatar = $(this).parents('.tbtopic').find('.tbtavatar');
  16. $(avatar).append('<img src="LINK DE TU AVATAR POR DEFECTO"/>');
  17. });
  18. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement