I have a .js
file on my site where I put some effects and everything. The problem is that you are acknowledging an Uncaught RangeError: Maximum call stack size exceeded alert and I do not know what it is.
Is it a code error? Because all commands and effects are executed normally.
My jQuery
is this:
jQuery(document).ready(function(){
//======================================================
// Ajuste automático da altura do background do header
var header = jQuery('#header'),
bg = jQuery('#bg'),
altura_janela = jQuery(window).height(),
altura_final = altura_janela - 125;
bg.css({ 'height': altura_final+'px' });
//======================================================
// Menu fixo
var headerBottom = 200;
jQuery(window).scroll(function() {
var scrollTop = jQuery(window).scrollTop(), menufixo = jQuery("#menu-fixo");
if (scrollTop > headerBottom) {
if (menufixo.is(":visible") == false) {
menufixo.fadeIn(300);
}
} else {
if (menufixo.is(":visible")) {
menufixo.fadeOut(300);
}
}
});
//======================================================
// Botão voltar ao topo
jQuery(window).scroll(function(){
var scrollTop2 = jQuery(window).scrollTop(), backtop = jQuery("#back-top");
if (scrollTop2 > 500) {
if (backtop.is(":visible") == false) {
backtop.fadeIn(200);
}
} else {
if (backtop.is(":visible")) {
backtop.fadeOut(100);
}
}
});
//======================================================
// Efeito âncoras
jQuery('a[href^="#"]').on('click',function(e){
e.preventDefault();
var target = this.hash;
if (target == '') { e.preventDefault(); }
else if (target == '#topo') {
jQuery('html, body').stop().animate({ 'scrollTop': 0 }, 900, 'swing');
}
else if (target == "#maisconteudo") {
jQuery('html, body').stop().animate({ 'scrollTop': 700 }, 900, 'swing');
}
else {
var Starget = jQuery(target),
alturadolink = Starget.offset().top,
alturaefeito = (alturadolink - 70);
jQuery('html, body').stop().animate({ 'scrollTop': alturaefeito }, 900, 'swing');
}
});
//======================================================
// Efeito seta que mexe
var imgSETABAIXO = jQuery('#seta');
jQuery(function() {
function setaShake() {
if (imgSETABAIXO.css('display') != 'none') {
imgSETABAIXO.animate({"padding":"30px 0"},600).animate({"padding":"24px 0"},400);
setTimeout(setaShake(),1500);
}
}
setaShake();
});
//======================================================
// Carousel de notícias
var carousel = jQuery('#carousel');
carousel.cycle({
fx: 'carousel',
carouselVisible: '3',
next: '.carousel-next',
prev: '.carousel-prev',
slides: '> .carousel-post',
timeout: '20000',
pager: '.carousel-pager',
pagerTemplate: '<a href="#">A</a>'
});
});
I believe the problem is in this effect: ( see online )
//======================================================
// Efeito seta que mexe
var imgSETABAIXO = jQuery('#seta');
jQuery(function() {
function setaShake() {
if (imgSETABAIXO.css('display') != 'none') {
imgSETABAIXO.animate({"padding":"30px 0"},600).animate({"padding":"24px 0"},400);
setTimeout(setaShake(),1500);
}
}
setaShake();
});
It is an effect that causes an arrow to move up and down, infinitely.
What can it be? Thank you.