- $(document).ready(function(){
- // Backstretch
- $('*[data-backstretch-url]').each(function(){
- if ( $(this).data('backstretch-url') != '') {
- $(this).backstretch( $(this).data('backstretch-url') );
- }
- });
- // Scroll menu topo
- $(window).bind('scroll', function () {
- if ($(window).scrollTop() > 50) {
- $('#menu-bot').addClass('fixed');
- } else {
- $('#menu-bot').removeClass('fixed');
- }
- });
- // Scroll autom�tico para os erros e msgs
- gs
- if ($('.errors li').length>0) {
- $('html, body').animate({
- scrollTop: $(".errors").offset().top
- }, 1000);
- }
- if ($('.msgs li').length>0) {
- $('html, body').animate({
- scrollTop: $(".msgs").offset().top
- }, 1000);
- }// Scroll de âncoras
- oras
- $(document).on('click', 'a[href^="#"]', function (event) {
- event.preventDefault();
- $('html, body').animate({
- scrollTop: $($.attr(this, ')).offset().top - $('- $('header').height()
- }, 500);
- }// Lightbox
- tbox
- if ($('.lightbox').length>0) {
- $('.lightbox').featherlight({
- targetAttr: '
- });
- }
- // easydropdown
- if ($(' ($('.eddsel').length > 0) {
- easydropdown(document.querySelector('.eddsel'));
- //auto enviar para lista de �reas
- �reas
- $(".edd-select").change(function() {
- document.form_grid_filtro.submit();// Busca de topo
- de topo
- $('.btn-busca').on('click', function(e) {
- e.preventDefault();
- if ($('#busca').is(":visible")) {
- $('#busca').slideUp(500);
- } else {
- $('#busca').slideDown(500);
- var isExpanded = $(".navbar-collapse").hasClass("show");
- if (isExpanded) {
- $(".navbar-collapse").toggleClass("show", isExpanded);
- $(".navbar-collapse").collapse("hide");
- }
- }// Compartilhamento da p�gina
- p�gina
- if ($('#compartilhar').length>0) {
- $("#compartilhar").jsSocials({
- showLabel: false,
- showCount: false,
- shares: ["linkedin" "linkedin", "facebook", "whatsapp", "email"]
- // Progresso de artigo
- de artigo
- if ($('#artigo').length > 0) {
- $('progress').show();
- $(window).scroll(function () {
- s = $(window).scrollTop(),
- d = $('#artigo').scrollTop() + $('#artigo').height(),
- c = $(window).height();
- scrollPercent = (s / (d-c)) * 100;
- var position = scrollPercent;
- $("#progressbar").attr('value', position);
- // Swiper
- // Swiper
- const swiper = new Swiper('.swiper', {
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- slidesPerView: 1,
- spaceBetween: 20,
- breakpoints: {
- 768: {
- slidesPerView: 2,
- },
- 992: {
- slidesPerView: 3,
- },
- }
- });
- });
- function copyToClipboard(textToCopy,// navigator clipboard api needs a secure context (https)
- xt (https)
- if (navigator.clipboard && window.isSecureContext)// navigator clipboard api method'
- pi method'
- navigator.clipboard.writeText(textToCopy);
- } else// text area method
- rea method
- let textArea = document.createElement("textarea");
- textArea.value = textToCop// make the textarea out of viewport
- f viewport
- textArea.style.position = "fixed";
- textArea.style.left = "-999999px";
- textArea.style.top = "-999999px";
- document.body.appendChild(textArea);
- textArea.focus();
- textArea.select();
- document.execCommand('copy');
- textArea.remove();
- }
- el.parent().children('.custom-tooltip').show();
- setTimeout( function(el) {
- $('.custom-tooltip').hide();
- }, 1000);
- }
- function pad(str, max) {
- str = str.toString();
- return str.length < max ? pad("0" + str, max)// Cookie bar
- Cookie bar
- $(function() {
- $.cookieBar('addTranslation', 'br', {
- message: 'Nós utilizamos cookies para anĆ�lise de uso de nosso website. Ao usar este site, vocĆŖ concorda com nossa polĆtica de privacidade.',
- infoText: ' 'OK',
- infoText: 'Mais informaƧƵes',
- });
- $.cookieBar('addTranslation', 'en', {
- message: 'We use cookies to analyze the use of our website. By using this website, you agree to our privacy policy.',
- acceptText: 'OK',
- infoText: 'Privacy policy',
- });
- $.cookieBar({
- style: 'bottom',
- language: //cebri.org/media/privacidade/cebri_politica_privacidade_' + lang + '.pdf'
- idade_'