-
-
Save cleytonmessias/3e0bd7d0b73e0baeb962 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Código para criar a âncora: | |
<div class="trustvox-link"> | |
<a id="trustvox-a" href="#trustvox-reviews"> | |
<img src="/arquivos/icon-ancora-trustvox-verde.png" /> | |
<span>Veja opiniões de quem já comprou</span> | |
</a> | |
</div> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Estilo (css) para html da âncora | |
.trustvox-link { | |
text-align: right; | |
margin: 10px 0px 0px; | |
} | |
.trustvox-link a { | |
font-size: 12px; | |
display: block; | |
text-decoration: none; | |
} | |
.trustvox-link img { | |
display: inline-block; | |
position: relative; | |
z-index: 1; | |
} | |
.trustvox-link span { | |
background-color: #F5F5F5; | |
border-bottom: 1px solid #d2d2d2; | |
color: #006E24; | |
position: relative; | |
top: -13px; | |
padding: 5px 10px 4px 15px; | |
margin-left: -10px; | |
border-radius: 3px; | |
} | |
.trustvox-link a:hover span {background-color: #DEE2E0;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Script para gerar o widget + efeito de rolagem lenta para click da âncora + customização: | |
<script type="text/javascript"> | |
//1-) Adicionar essa linha | |
_trustvox.push(['_css', ["//trustvox.production.widget.s3-sa-east-1.amazonaws.com/assets/stylesheets/efacil.css"]]); | |
(function() { | |
var tv = document.createElement('script'); tv.type = 'text/javascript'; tv.async = true; | |
tv.charset = "UTF-8"; | |
tv.src = '//trustvox-production-assets.s3.amazonaws.com/assets/trustvox.1.min.js'; | |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tv, s); | |
})(); | |
// 2-) Adicionar esse bloco | |
$('#trustvox-a').click(function(){ | |
$('html, body').animate({ | |
scrollTop: $( $.attr(this, 'href') ).offset().top | |
}, 500); | |
return false; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment