Sto costruendo un div e aggiungendolo a un div principale. Mentre faccio questo ho bisogno di ottenere l'altezza del div appena lo costruisco e prima di aggiungerlo.Jquery - Ottenere l'altezza del div costruito
per esempio,
<script>
$(function(){
var text = $("#ObjText").html(); // This text is dynamic
var dv = $("<div id='childDiv'>"+text+"</div>");
alert($(dv).height()); // This is getting '0' - Need to get the height of the div here.
$("#page").append(dv);
//After appending to page able to get the height of the child div
alert($("#childDiv").height());
});
</script>
nel mio corpo Tag,
<body>
<div id="page"></div>
</body>
Please help me su questo. Grazie in anticipo.
Dannazione l'ho completamente perso, questo ha senso, grazie Murtaza. – Max
siete i benvenuti! – Murtaza