Campo dos emblemas

4 participantes

Ver o tópico anterior Ver o tópico seguinte Ir para baixo

Tópico resolvido Campo dos emblemas

Mensagem por Punisher 26.06.18 17:54

Detalhes da questão


Endereço do fórum: http://nwdgames.forumbrasil.net
Versão do fórum: ModernBB

Descrição


Olá pessoal, meu campo de emblemas só ficam com 1, mas eu gostaria que fosse possível adicionar + de 1 emblema em cada perfil, então estou usando este código:
Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
   
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
         
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: center;',
  '  margin: 10px 0;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas::before {',
  '  content: "Emblemas";',
  '  display: block;',
  '  font-size: 13px;',
  '  margin-bottom: 6px;',
  '  font-weight: 500;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  display: inline-block;',
  '  margin-right: 6px;',
  '  border: solid 1px #ddd;',
  '  padding: 3px;',
  '  box-shadow: inset 0 0 0 2px #ddd;',
  '}'
]));

Porém não fica como eu quero, eu queria que ficasse assim:
https://i.imgur.com/XqsuSVH.png

Como fica:
http://prntscr.com/jzmyd3
Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Admineiro

Tópico resolvido Re: Campo dos emblemas

Mensagem por tikky 26.06.18 18:44

Olá @Punisher,
Mude para:
Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
 
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
       
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: left;',
  '  margin: 10px 0;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas::before {',
  '  content: "Emblemas";',
  '  display: block;',
  '  font-size: 13px;',
  '  margin-bottom: 6px;',
  '  font-weight: 500;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  display: inline-block;',
  '  text-align: left;',
  ' float: left!important;',
  '  margin-right: 0px;',
  '  border: solid 1px #ddd;',
  '  padding: 3px;',
  '  box-shadow: inset 0 0 0 2px #ddd;',
  '}'
]));

- pedxz
tikky

tikky
Admineiro
Admineiro

Membro desde : 13/01/2017
Mensagens : 7806
Pontos : 9052

Ir para o topo Ir para baixo

Tópico resolvido Re: Campo dos emblemas

Mensagem por Punisher 26.06.18 18:53

Veja como ficou: http://prntscr.com/jznpok bugou os icones de mensagem etc.
Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Campo dos emblemas

Mensagem por RafaelS. 26.06.18 20:25

Olá amigo!

Remova os códigos passados acima, e tente utilizar o seguinte:

Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
  
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
        
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
$('.perfil-emblemas').parents().prepend('<span><strong>Emblemas</strong></span>');
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: center;',
  '  margin: 10px 0;',
  '  display: inline;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas::before {',
  '  content: "Emblemas";',
  '  display: block;',
  '  font-size: 13px;',
  '  margin-bottom: 6px;',
  '  font-weight: 500;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  height: 50px;',
  '  width: 50px;',
  '  padding: 5px;',
  '}'
]));

Até mais.
RafaelS.

RafaelS.
Membro Entusiasta
Membro Entusiasta

Membro desde : 26/04/2014
Mensagens : 5746
Pontos : 7156

http://techmais.forumeiros.com/

Ir para o topo Ir para baixo

Tópico resolvido Re: Campo dos emblemas

Mensagem por Punisher 26.06.18 20:47

Bugou mais ainda http://prntscr.com/jzp47j
Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Campo dos emblemas

Mensagem por RafaelS. 26.06.18 21:44

Oups!

Troque por este:

Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
  
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
        
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
$('.perfil-emblemas').parent().prepend('<span><strong>Emblemas</strong></span><br />');
$('.perfil-emblemas br').remove();
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: center;',
  '  margin: 10px 0;',
  '  display: inline;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  height: 50px;',
  '  width: 50px;',
  '  padding: 5px;',
  '}'
]));
RafaelS.

RafaelS.
Membro Entusiasta
Membro Entusiasta

Membro desde : 26/04/2014
Mensagens : 5746
Pontos : 7156

http://techmais.forumeiros.com/

Ir para o topo Ir para baixo

Tópico resolvido Re: Campo dos emblemas

Mensagem por Punisher 26.06.18 21:52

Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Campo dos emblemas

Mensagem por RafaelS. 26.06.18 21:54

Acho que agora vai @Punisher,

Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
  
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
        
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
$('.perfil-emblemas').parent().prepend('<span><strong>Emblemas</strong></span><br>');
$('.perfil-emblemas br').remove();
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: center;',
  '  margin: 10px 0;',
  '  display: inline;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  height: 50px;',
  '  width: 50px;',
  '  padding: 5px;',
  '}'
]));
RafaelS.

RafaelS.
Membro Entusiasta
Membro Entusiasta

Membro desde : 26/04/2014
Mensagens : 5746
Pontos : 7156

http://techmais.forumeiros.com/

Ir para o topo Ir para baixo

Tópico resolvido Re: Campo dos emblemas

Mensagem por Punisher 26.06.18 22:00

Perfeito, poderia deixar o "Emblema" em preto? igual os outros perfis
Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Membro Entusiasta

Tópico resolvido Re: Campo dos emblemas

Mensagem por RafaelS. 26.06.18 22:01

Claro!

Código:
(function ($, css) {
  'use strict';
 
  $(function () {
    $('.post_field').each(function () {
      var $this = $(this);
      var _text = $this.text();
 
      if (!/emblemas/gi.test(_text)) {
        return;
      }
 
      $this.addClass('perfil-emblemas');
  
      $this
        .find('img')
          .each(function () {
            var $this = $(this);
 
            $this.attr('title', $this.next('strong').text());
        
            $this.tooltipster();
          })
      ;
    });
 
    $('<style>', { 'text': css.join('\n') }).appendTo('head');
$('.perfil-emblemas').parent().prepend('<span style="color:black"><strong>Emblemas</strong></span><br>');
$('.perfil-emblemas br').remove();
  });
}(jQuery, [
  '.perfil-emblemas {',
  '  font-size: 0;',
  '  text-align: center;',
  '  margin: 10px 0;',
  '  display: inline;',
  '}',
  '',
  '.perfil-emblemas * {',
  '  transition: none !important;',
  '}',
  '',
  '.perfil-emblemas img {',
  '  height: 50px;',
  '  width: 50px;',
  '  padding: 5px;',
  '}'
]));


Última edição por RafaelS. em 26.06.18 22:03, editado 1 vez(es) (Motivo da edição : Cor.)
RafaelS.

RafaelS.
Membro Entusiasta
Membro Entusiasta

Membro desde : 26/04/2014
Mensagens : 5746
Pontos : 7156

http://techmais.forumeiros.com/

Ir para o topo Ir para baixo

Tópico resolvido Re: Campo dos emblemas

Mensagem por Punisher 26.06.18 22:11

Perfeito, agradeço muito, podem fechar.
Punisher

Punisher
***

Membro desde : 16/10/2017
Mensagens : 167
Pontos : 284

http://rota-nwd.forumeiros.com

Ir para o topo Ir para baixo

Principal Contribuidor

Tópico resolvido Re: Campo dos emblemas

Mensagem por Shek 27.06.18 1:28

Tópico resolvido


Movido para "Questões resolvidas".
Shek

Shek
Principal Contribuidor
Principal Contribuidor

Membro desde : 11/04/2009
Mensagens : 18896
Pontos : 22793

https://shiftactive.blogspot.com/ https://www.facebook.com/ShiftActif https://twitter.com/ShiftActif

Ir para o topo Ir para baixo

Ver o tópico anterior Ver o tópico seguinte Ir para o topo

- Tópicos semelhantes

Permissões neste sub-fórum
Não podes responder a tópicos