Boas-vindas ao Power Pixel

Junte-se a comunidade! Crie o seu próprio conteúdo, e faça amizades.EntrarCriar uma conta

Houdini Houdini  • Sex 16 Ago 2013 - 17:43

[Tutorial]Botão Curtir Igual BS Empty [Tutorial]Botão Curtir Igual BS Sex 16 Ago 2013 - 17:43

Qual é minha questão:
Segui o tutorial abaixo.

[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

O mesmo foi funcional, mais vejam a imagem abaixo:

[Tens de ter uma conta e sessão iniciada para poderes visualizar esta imagem]

Gostaria de colocar o botão de curtir, que está dentro do quadrado vermelho, fosse para o lugar do quadrado verde, tem como?

Endereço do meu fórum:
[Tens de ter uma conta e sessão iniciada para poderes visualizar este link]

Versão:
PunBB

Daemon Daemon  • Sex 16 Ago 2013 - 19:57

[Tutorial]Botão Curtir Igual BS Empty Re: [Tutorial]Botão Curtir Igual BS Sex 16 Ago 2013 - 19:57

Reputação da mensagem: 100% (1 votos)
Troque a css do cód por este:
Código:
/*like*/
.LGvote {display: inline-block;float: right;}
.LGlike {
background: url(http://i11.servimg.com/u/f11/18/07/42/17/ok12.png) no-repeat left;
background-color: #326A94;
border: 1px solid rgba(0, 0, 0, 0.3);
border-radius: 2px 2px 2px 2px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0 rgba(255, 255, 255, 0.3) inset;
color: white;
cursor: pointer;
display: inline-block;
font-size: 11px;
height: 20px;
line-height: 20px;
padding: 0 18px;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
white-space: nowrap;
margin-right: 5px;
}
 .LGvote { margin: 0 5px; }
 .LGnovote {
  filter:Alpha(opacity=50);
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  text-shadow: none;
 }
Depois troque o primeiro código JS por este:
Código:
function lglike(b,a){var d=a.innerHTML;a.innerHTML="Loading...";a.onclick="#";$.get(b,function(){a.className+=" LGnovote";a.innerHTML=d;var c=a.nextSibling,b=parseInt(/\d+/.exec(c.innerHTML)[0])+1;c.innerHTML=c.innerHTML.replace(/\d+/,b)})};

function init_lg_like_system() {
    var x = $('.vote');
    for (var i = 0, l = x.length; i < l; i++) {
        var vote = x[i],
            count = 0,
            plus = 0;
        var bar = $('.vote-bar', vote)[0];
        var button = $('.vote-button', vote)[0];
        if (bar) {
            var info = bar.title.match(/\d+/g);
            count = info[0];
            var percent = info[1];
            plus = Math.round(parseInt(percent) * parseInt(count)) / 100;
        }
        button = button ? '<span onclick="lglike(\'' + button.firstChild.href + '\',this);" class="LGlike">' + vote_singular + '</span>' : '<span class="LGlike LGnovote">' + vote_singular + '</span>';

        var votes_text = '<span class="LGlikecount">' + plus + ' ' + (plus == 1 ? vote_singular : vote_plural) + '</span>';

        if (like_version === 'phpbb3' || like_version === 'PHPBB3') {
            $('.corners-bottom', vote.parentNode.parentNode)
        .before('<div class="LGvote" style="margin:3px">' + button + votes_text + '</div>');
        } else if (like_version === 'invision' || like_version === 'Invision' || like_version === 'INVISION') {
            $(vote.parentNode.parentNode.parentNode.nextSibling.lastChild)
        .prepend('<li><div class="LGvote">' + button + votes_text + '</div></li>');
        } else if (like_version === 'punbb' || like_version === 'PUNBB') {
            $('.posthead h2', vote.parentNode.parentNode.parentNode.parentNode)
        .append('<div class="LGvote">' + button + votes_text + '</div>');
        }
          else if (like_version === 'PHPBB2' || like_version === 'phpbb2') {
            $('td.post tr:last')
        .append('</br></br><div class="LGvote" style="margin:3px">' + button + votes_text + '</div>');
        }
    }
x.remove();
};

if (DOM_IS_READY == true) {
    init_lg_like_system();
} else {
    $(function () {
        init_lg_like_system();
    });
}
Até mais!

Houdini Houdini  • Sex 16 Ago 2013 - 20:37

Daemon Daemon  • Sex 16 Ago 2013 - 20:46

[Tutorial]Botão Curtir Igual BS Empty Re: [Tutorial]Botão Curtir Igual BS Sex 16 Ago 2013 - 20:46

[sucesso=Tópico Resolvido; e Bloqueado][/sucesso]Movido para: Arquivo - Pedido de código

Conteúdo patrocinado  • 

[Tutorial]Botão Curtir Igual BS Empty Re: [Tutorial]Botão Curtir Igual BS

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