Aumentar o tamanho do conteúdo em dispositivos móveis

2 participantes

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

Tópico resolvido Aumentar o tamanho do conteúdo em dispositivos móveis

Mensagem por Nier 10.10.21 20:03

Detalhes da questão


Endereço do fórum: https://endeligesynd.forumeiros.com/
Versão do fórum: ModernBB

Descrição


Bom dia/boa tarde/boa noite.

Eu estou com um fórum novo, e quero inserir um botão para mudar a fonte, mas quando eu o coloco, ele não funciona. Eu pedi ele um tempo atrás para meu outro fórum, em phpBB3, o código dele é esse abaixo. É possível atualizar o código para funcionar em ModernBB?

Código:
$(function() {
  // font sizes
  var sizes = [
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23,
    24
  ],
 
  // position of the selector
  // 0 = top
  // 1 = bottom
  position = 0,
  attachTo = '#page-body, #ipbwrapper #content-container', // element(s) where the selector will be attached
 
  // language config
  lang = {
    Default : 'Default',
    FontSize : 'Font Size : '
  },
 
 
  cookie = my_getcookie('fa_fontsize'), // selected font size
 
  selector = $('<select id="fa_fontsize" />')[0], // font size selector
  container = $('<div id="fa_fontsize_container"><span id="fa_fontsize_label" style="font-size:12px">' + lang.FontSize + '</span></div>')[0], // selector container
 
  // options string
  html = '<option value="default:' + window.getComputedStyle(document.body, null).getPropertyValue('font-size') + '" ' + ( /default/i.test(cookie) ? 'selected' : '' ) + '>' + lang.Default + '</option>',
 
  // loop variables
  i = 0, j = sizes.length,
 
  // function for changing the font size
  change = function(init, val) {
    var value = init === true ? val : this.value;
 
    my_setcookie('fa_fontsize', value);
 
    document.body.style.fontSize = /default/i.test(value) ? value.replace(/default:/, '') : value + 'px';
  };
 
  // loop through the sizes array to create an options list for the selector
  for (; i < j; i++) {
    html += '<option value="' + sizes[i] + '" ' + (cookie == sizes[i] ? 'selected' : '') + '>' + sizes[i] + '</option>';
  }
 
  // apply the html and event handler to the selector
  selector.innerHTML = html;
  selector.onchange = change;
 
  // apply the chosen font size if any was selected
  if (cookie) {
    change(true, cookie);
  }
 
  // add the selector to the container and finally the document
  container.appendChild(selector);
  $(attachTo)[['prepend', 'append'][position]](container);
});
Nier

Nier
*

Membro desde : 07/10/2019
Mensagens : 38
Pontos : 64

http://signs-of-hope.forumeiros.com/

Ir para o topo Ir para baixo

Admineiro

Tópico resolvido Re: Aumentar o tamanho do conteúdo em dispositivos móveis

Mensagem por tikky 13.10.21 14:27

Olá @Nier,

Adicione na sua folha de estilo (CSS) o seguinte código:
Código:
#modernbb * {
    font-size: inherit !important;
}

Atenciosamente,
pedxz.
tikky

tikky
Admineiro
Admineiro

Membro desde : 13/01/2017
Mensagens : 7816
Pontos : 9062

Ir para o topo Ir para baixo

Tópico resolvido Re: Aumentar o tamanho do conteúdo em dispositivos móveis

Mensagem por Nier 14.10.21 8:01

Funcionou, pode fechar.
Nier

Nier
*

Membro desde : 07/10/2019
Mensagens : 38
Pontos : 64

http://signs-of-hope.forumeiros.com/

Ir para o topo Ir para baixo

Admineiro

Tópico resolvido Re: Aumentar o tamanho do conteúdo em dispositivos móveis

Mensagem por tikky 14.10.21 14:27

Tópico resolvido


Movido para "Questões resolvidas".
tikky

tikky
Admineiro
Admineiro

Membro desde : 13/01/2017
Mensagens : 7816
Pontos : 9062

Ir para o topo Ir para baixo

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


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