Jump to content

height de div?


coxosclassic

Recommended Posts

Hey hey!

Boas a todos,

Desculpem a pergunta básica, mas alguem me pode dar uma ajuda em aceder ao valor de height de uma div? 😛

eis o meu problema:

js:

content = document.getElementById("content");

alert(content.innerHeight); // retorna undefined

html:

<div id=container>
<div id="content">ALGUM TEXTO MUITO LONGO...</div>
</div>

Tenho a div 'content' com texto dinamico e precisava de saber a sua altura para poder fazer umas animacoes com div 'container'.

Alguma dica?

cumps,

cc

Edited by coxosclassic

Cumps,

cc

Link to comment
Share on other sites

http://www.quirksmode.org/dom/getstyles.html

acho que seria

alert(content.style.width);

Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender.

A beleza de um código está em decompor problemas complexos em pequenos blocos simples.

"learn how to do it manually first, then use the wizzy tool to save time."

"Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."

Link to comment
Share on other sites

eu mandei o link mesmo por isso 😉

obg pelo link

CRLF

👍

cumps,

cc

Nao e' "CRLF" e' pikax, senao o teu nick seria "Try-Catch User " 😉

Por muito mais que que estude só aprendo uma coisa, que ainda tenho muita coisa para aprender.

A beleza de um código está em decompor problemas complexos em pequenos blocos simples.

"learn how to do it manually first, then use the wizzy tool to save time."

"Kill the baby, don't be afraid of starting all over again. Fail soon, learn fast."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.