PageSourceSearch

https://icabrasil.org/wp-content/themes/icab2023_vs1/includes/js/scripts.js?ver=7.1.2

js icabrasil.org collected 2026-10-05 05:07:14 UTC 11,716 bytes, 337 lines download raw bytes

1jQuery(document).ready(function($) {
2	//preload ini
3    var Body = $('body');
4    Body.addClass('preloader-site');
5
6	$(window).load(function() {
7		$('.preloader-wrapper').fadeOut();
8		$('body').removeClass('preloader-site');
9	});
10	//preload fim
11
12
13	// funções de scroll
14	//exibe menu top de acordo com scroll
15	
16	    $(window).scroll(function() {
17		var scroll = $(window).scrollTop();
18
19			var scroll_limit = 10
20
21			if (scroll >= scroll_limit) {
22				$("#top-wrapper").addClass("fixed");
23				$(".menu3").addClass("fixed");
24				$('a.bt-top').css('opacity',1);
25				$('.footer-fixo').css('bottom',0);
26				$(".bt-scroll").addClass("inativo");
27			} else {
28				$("#top-wrapper").removeClass("fixed");
29				$(".menu3").removeClass("fixed");
30				$('.footer-fixo').css('bottom',-400);
31				$('a.bt-top').css('opacity',0);
32				$(".bt-scroll").removeClass("inativo");
33			}
34
35		});
36		
37		$('.bt-scroll').click(function() {
38			//$('.content').scrollTop(100);
39			//$('footer').scrollTop(100);
40			//document.getElementById('footer').scrollIntoView(-200);
41			document.querySelector('#quem-somos').scrollIntoView({ behavior: 'smooth' })
42		});
43		$('a.bt-top').click(function() {
44			//$('.content').scrollTop(100);
45			//$('footer').scrollTop(100);
46			//document.getElementById('footer').scrollIntoView(-200);
47			document.querySelector('#top').scrollIntoView({ behavior: 'smooth' })
48		});
49
50
51// exibe o menu top quando rola a página para cima, ao rolar para baixo o menu some
52var lastScrollTop = 0;
53window.addEventListener("scroll", function(){
54   var st = window.pageYOffset || document.documentElement.scrollTop;
55   if (st > lastScrollTop){
56       document.getElementById("top-wrapper").style.top = "-200px";
57			 //document.getElementsByClassName("footer-fixo").style.bottom = "0";
58   } else {
59      document.getElementById("top-wrapper").style.top = "0";
60			//document.getElementsByClassName("footer-fixo").style.bottom = "-100px";
61   }
62   lastScrollTop = st;
63}, false);
64
65//SCROLL SUAVE
66// Select all links with hashes
67$('a[href*="#"]')
68  // Remove links that don't actually link to anything
69  .not('[href="#"]')
70  .not('[href="#0"]')
71  .click(function(event) {
72    // On-page links
73    if (
74      location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') 
75      && 
76      location.hostname == this.hostname
77    ) {
78      // Figure out element to scroll to
79      var target = $(this.hash);
80      target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
81      // Does a scroll target exist?
82      if (target.length) {
83        // Only prevent default if animation is actually gonna happen
84        event.preventDefault();
85        $('html, body').animate({
86          scrollTop: target.offset().top
87        }, 1000, function() {
88          // Callback after animation
89          // Must change focus!
90          var $target = $(target);
91          $target.focus();
92          if ($target.is(":focus")) { // Checking if the target was focused
93            return false;
94          } else {
95            $target.attr('tabindex','-1'); // Adding tabindex for elements not focusable
96            $target.focus(); // Set focus again
97          };
98        });
99      }
100    }
101  });
102
103
104	
105	
106$('.menu-trigger-bt').click(function() {
107	$('#menu-oculto-container').addClass('active');
108	$(this).addClass('disable');
109	$("#top-wrapper").addClass("menu-aberto");
110	
111})	
112$('.menu-oculto-bt-fechar').click(function() {
113		$('#menu-oculto-container').removeClass('active');
114		$("#top-wrapper").removeClass("menu-aberto");
115		$('ul.menu').removeClass('active');
116		$('.bt-voltar').removeClass('active');
117		$('.menu-trigger-bt').removeClass('disable')
118		$("#top-wrapper").addClass("vamos");
119		$('ul.menu').removeClass('active');
120		$('.sub-menu').removeClass('active');
121		$('.sub-menu-wrap').removeClass('active');
122		$('.menu li a').removeClass('active');
123		$('.menu li').removeClass('active');
124})	
125
126$('#menu a').click(function() {
127	if($('#menu-trigger').hasClass('active')) {
128		$('#header #menu-container').removeClass('active');
129		$('#menu-trigger').removeClass('active');
130	} else {
131		$('#header #menu-container').addClass('active');
132		$('#menu-trigger').addClass('active');
133	}
134	$('#menu-oculto-container').removeClass('active');
135		$("#top-wrapper").removeClass("menu-aberto");
136		$('ul.menu').removeClass('active');
137		$('.bt-voltar').removeClass('active');
138		$('.menu-trigger-bt').removeClass('disable')
139		$("#top-wrapper").addClass("vamos");
140		$('ul.menu').removeClass('active');
141		$('.sub-menu').removeClass('active');
142		$('.sub-menu-wrap').removeClass('active');
143		$('.menu li a').removeClass('active');
144		$('.menu li').removeClass('active');
145});
146
147$('#menu li.contato').click(function() {
148		$('#menu-oculto-container').removeClass('active');
149		$("#top-wrapper").removeClass("menu-aberto");
150		$('ul.menu').removeClass('active');
151		$('.bt-voltar').removeClass('active');
152		$('.menu-trigger-bt').removeClass('disable')
153		$("#top-wrapper").addClass("vamos");
154		$('ul.menu').removeClass('active');
155		$('.sub-menu').removeClass('active');
156		$('.sub-menu-wrap').removeClass('active');
157		$('.menu li a').removeClass('active');
158		$('.menu li').removeClass('active');
159});
160	
161//MOBILE
162$('.menu li a').click(function() {
163  $('.menu li').removeClass('active');
164  $('.sub-menu').removeClass('active');
165  $(this).parent().addClass('active');
166});
167$('.menu li a').click(function() {
168  $('.menu li').removeClass('active');
169  $(this).parent().addClass('active');
170});	
171	
172if( /Android|iPad/i.test(navigator.userAgent) || $(window).width() < 700 ) {
173	$('li.menu-item-has-children > a').click(function(event) {
174		event.preventDefault();
175		
176		$('.menu li a').removeClass('active');
177		$(this).addClass('active');
178		$(this).parents('li').find('ul').addClass('active');
179		$(this).parents('li').find('.sub-menu-wrap').addClass('active');
180		
181		$('ul.menu').addClass('active');
182		$('.menu-bloco .bt-voltar').addClass('active');
183		$(this).find('.sub-menu').addClass('active');
184	});
185	
186	$('.menu-bloco .bt-voltar').click(function() {
187		$('ul.menu').removeClass('active');
188		$('.sub-menu').removeClass('active');
189		$('.sub-menu-wrap').removeClass('active');
190		$(this).removeClass('active');
191		$('.menu li a').removeClass('active');
192		$('.menu li').removeClass('active');
193	});
194
195	
196} else {
197	$('li.menu-item-has-children').hover(function() {
198		$(this).find('ul').addClass('active');
199	}, function() {
200		$(this).find('ul').removeClass('active');
201	});
202}
203
204//***
205
206//SEARCH TRIGGER + AREA
207$('.search-trigger').click(function() {
208	$('#search-area').addClass('active');
209	$('#search-area').find('input.search-field').focus();
210});
211$('.search-trigger-close').click(function() {
212	$('#search-area').removeClass('active');
213});
214/-------------------/
215	
216//MAGNIFIC POPUP GALERIA INI
217$('.gallery').each(function() { // the containers for all your galleries
218    $(this).magnificPopup({
219        delegate: 'a', // the selector for gallery item
220        type: 'image',
221        gallery: {
222          enabled:true
223        }
224    });
225});
226//magnific-pop galeria pagina
227$('.galeria-item').magnificPopup({
228  delegate: 'a', // child items selector, by clicking on it popup will open
229  type: 'image',
230  // other options
231  image: {
232	  markup: '<div class="mfp-figure">'+
233              '<div class="mfp-close"></div>'+
234              '<div class="mfp-img"></div>'+
235              '<div class="mfp-bottom-bar teste">'+
236              '<div class="mfp-title">oi</div>'+
237              '<div class="mfp-counter"></div>'+
238              '</div>'+
239          '</div>', // Popup HTML markup. `.mfp-img` div will be replaced with img tag, `.mfp-close` by close button
240
241        //tError: '<a href="../../../gabbai-vs3/includes/js/%url%">The image #%curr%</a> could not be loaded.',
242        //verticalFit: false,
243        //titleSrc: 'title',
244		//titleSrc: function(item) {
245        //    return item.el.parents('.galeria-infos').find('.galeria-legenda').text();
246        //},
247		titleSrc: function(item) {
248    		return item.el.find('img').attr('alt');
249		}
250
251   },
252
253
254
255  gallery:{
256    enabled:true
257  },
258  mainClass: 'mfp-with-zoom', // this class is for CSS animation below
259  zoom: {
260    enabled: true, // By default it's false, so don't forget to enable it
261
262    duration: 300, // duration of the effect, in milliseconds
263    easing: 'ease-in-out', // CSS transition easing function
264
265    // The "opener" function should return the element from which popup will be zoomed in
266    // and to which popup will be scaled down
267    // By defailt it looks for an image tag:
268    opener: function(openerElement) {
269      // openerElement is the element on which popup was initialized, in this case its <a> tag
270      // you don't need to add "opener" option if this code matches your needs, it's defailt one.
271      return openerElement.is('img') ? openerElement : openerElement.find('img');
272    }
273  }
274});
275// MAG.POPUP GALERIA FIM
276
277//DESABILITA O SCROLL ZOOM DO GOOGLE MY MAPS
278		$('.mapa iframe').addClass('scrolloff');                // set the mouse events to none when doc is ready
279
280        $('.mapa').on("mouseup",function(){          // lock it when mouse up
281            $('.mapa iframe').addClass('scrolloff');
282            //somehow the mouseup event doesn't get call...
283        });
284        $('.mapa').on("mousedown",function(){        // when mouse down, set the mouse events free
285            $('.mapa iframe').removeClass('scrolloff');
286        });
287
288        $(".mapa iframe").mouseleave(function () {              // becuase the mouse up doesn't work...
289            $('.mapa iframe').addClass('scrolloff');            // set the pointer events to none when mouse leaves the map area
290                                                        // or you can do it on some other event
291        });
292//FIM
293//popup forms página investidores gabbai
294	$('.open-popup-form').magnificPopup({
295	  type:'inline',
296	  midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href.
297	});
298
299//popup de mensagens de rro do copntact form7
300$('.wpcf7-validation-errors, .wpcf7-acceptance-missing, .wpcf7 form.invalid, .wpcf7-response-output').click(function(){
301 $(this).addClass('hidden');
302})
303$('.wpcf7-submit').click(function() {
304	$('.wpcf7-validation-errors, .wpcf7-acceptance-missing, .wpcf7 form.invalid, .wpcf7-response-output').removeClass('hidden');
305})
306
307
308//POPUP DE VIDEOS INI
309	jQuery('.video-link').magnificPopup({
310		 type: 'iframe',
311		 iframe: {
312		  markup: '<div class="mfp-iframe-scaler">'+
313					'<div class="mfp-close"></div>'+
314					'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
315				  '</div>', // HTML markup of popup, `mfp-close` will be replaced by the close button
316
317		  patterns: {
318			youtube: {
319			  index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
320
321			  id: 'v=', // String that splits URL in a two parts, second part should be %id%
322			  // Or null - full URL will be returned
323			  // Or a function that should return %id%, for example:
324			  // id: function(url) { return 'parsed id'; }
325
326			  src: '//www.youtube.com/embed/%id%?autoplay=1' // URL that will be set as a source for iframe.
327			},
328		  },
329		  srcAction: 'iframe_src', // Templating object key. First part defines CSS selector, second attribute. "iframe_src" means: find "iframe" and set attribute "src".
330		}
331	});
332//POPUP DE VIDEOS FIM
333
334//ativa as animações do wow
335    new WOW().init();
336
337});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.