Hola a tod@s, hoy he empezado con jQuery, y ya me ha surgido esta duda: ¿cómo puedo utilizar una variable JavaScript (ej: var myvar = 50;) en jQuery?
Código JavaScript
:
Ver originalvar trueWidth = this.width;
var trueHeight = this.height;
$(this).animate({width:trueWidth,height:trueHeight},"slow");
Necesito asignarle al width y height del animate las variables trueWidth y trueHeight respectivamente, pero no me funciona del modo que ahí muestro. ¿Algún consejo? (repito que hoy mismo he empezado con jQuery y estoy totalmente verde

).
Otra pregunta: ¿Cómo puedo acceder a las propiedades de un objeto en jQuery? (ej: $("#elemento").width)?