Skip to content

Instantly share code, notes, and snippets.

@guilhermeteodoro
Last active August 29, 2015 14:06
Show Gist options
  • Save guilhermeteodoro/d62d57129ab2a8867299 to your computer and use it in GitHub Desktop.
Save guilhermeteodoro/d62d57129ab2a8867299 to your computer and use it in GitHub Desktop.

Removendo o fix existente

Quando for deployada a remoção do fix dos bgs acontecerá a seguinte situação:

error

Esse fix remove uma regra de css que obriga o background subir:

  • No Click Jogos background-position: 50% -31px !important
  • No Jogos de Meninas background-position: 50% -29px !important

O fix feito do lado do DFP será inserir um código javascript pra fazer a mesma modificação, fazendo o background subir novamente:

$(document).ready(function(){
  el = $('#background_zone .container span');
  if (el.length < 1) { el = $('#background_zone .container a'); }
  css = el.attr('style');
  height = location.host.match(/clickjogos|cjogos/) ? '-31px' : '-29px';
  el.attr('style', css + ' background-position: 50% ' + height + ' !important;');
});

Isso só será inserido para os canais que estão com o spec antigo, os próximos canais cadastrados devem ser planejados com a altura nova e inseridos sem este fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment