0
My code is generating error and what I researched would be syntax error but I can’t find it here and Sublime Text 2 has no broker. Could you help me? Follow the code:
var Padrao = {
/**
* Init
*/
init : function(){
//Exibe Tela de Login/Minha Conta
$('.login').click(Padrao.abreLogin);
//Exibe Carrinho de Compras
$('.carrinho-botao').click(Padrao.exibeCarrinho);
//Chama o carrousel de Banner
Padrao.carrouselBanner();
},
//Exibe Tela de Login/Minha Conta
abreLogin : function(){
$('.minha-conta').toggle(200);
},
//Exibe Carrinho de Compras
exibeCarrinho : function(){
$('.carrinho-aberto').toggle(200);
},
//Carrousel de banner
carrouselBanner : function(){
//recupera a qtd de elementos da lista
var elementos = $('.destaque-banner ul li').length;
//atribui automatico o valor de width para a ul
$('.destaque-banner ul').css({width : 990 * elementos});
//define e imprime a quantidade de bullets de acordo com o numero de elementos
for(var i = 0; i < elementos; i++){
if(i == 0){
$('.bullets-area ul').append('<li><a href="javascript:void" index="' + parseInt(i) + '" class="sel"> x </a></li>');
} else {
$('.bullets-area ul').append('<li><a href="javascript:void" index="' + parseInt(i) + '"> x </a></li>');
}
}
$('.bullets-area ul li a').click(function(){
var desloca = $(this).attr('index');
//alert(desloca);
$('.destaque-banner ul').animate({'margin-left': desloca * -1000});
});
}
};
$(Padrao.init);
The mistake is just
Uncaught SyntaxError: Unexpected end of input
? There is no further detail that could help identify the error?– Math
There is nothing wrong with your code, I tested it on a compiler and does not accuse errors. Where you are declaring it/calling on your page?
– Paulo Roberto Rosa
Amigo Paulo Roberto. The error that the browser was accusing was where I set href="javascript:void". It was missing (0). My fault but I found out. I appreciate the help.
– dsantoro
Post it as reply @user5101 :}
– Paulo Roberto Rosa
As Pauloroberto said, post as response and select your own answer
– fotanus