I'm having problems with the following code:
//Desktop = D
var posicaoMenuD = $('#desktop-menu').position().top();
$(document).scroll(function(){//Alscutador de scroll da página
var posicaoScrollD = $(document).scrollTop(); //Obtém o scroll atual (posição)
if (posicaoMenuD < posicaoScrollD){
$("#desktop-menu").css('top':$("#desktop-top-menu").height().val());
}
});
I'm trying to pass variables in the property .css()
of jquery
, but, without success, I tried declaring the variable before too, but it did not work in console
, the message:
scrolls-home.js:6 Uncaught SyntaxError: missing ) after argument list
I would like to know how I can solve this problem, and if possible, an explanation accompanied by the code, because I want to understand what is going on.