Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Esse é a porra do HTML, esse addthis:url era para ser a url q vai ser compartilhada
- <a id="contato-share" class="social addthis_button" addthis:url="" addthis:title="Ellen Oleria - Contato">Compartilhe</a>
- // Só que ele tb pode ser passado pela variável addthis_share.url , mas qdo eu passo, não está surtindo efeito
- // o código que atualiza o hash é o seguinte...
- hash = window.location.hash;
- if( hash !== ''){
- $('#contato-tabs a[href=' + hash + ']').tab('show');
- }
- $(window).on('hashchange', function(){
- if (!window.location.origin){
- window.location.origin = window.location.protocol+"//"+window.location.host;
- }
- base_url = window.location.origin + window.location.pathname;
- new_hash = window.location.hash;
- $('#contato-tabs a[href=' + new_hash + ']').tab('show');
- //Essa porra não surte efeito, será q precisa fazer algum binding diferente?
- if(!typeof addthis_share === 'undefined'){
- addthis_share.url = base_url + new_hash;
- }
- });
- $('a[data-toggle="tab"]').on('show.bs.tab', function(e){
- window.location.hash = $(e.target).attr('href');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement