Show height and width
Show the height and width of a div after .hide() and after .show().
by burhans
HTML
<div id="blam">
</div>
<div style="margin-top: 10px">
<button id="kapow">Kapow</button>
</div>
CSS
div#blam
{
border-color: black;
border-style: solid;
border-width: 1px;
height: 41px;
width: 40px;
}
JavaScript
var hidden = false;
$("#kapow").on("click", function(event)
{
var message;
if (hidden === false)
{
$("#blam").hide();
hidden = true;
}
else
{
$("#blam").show();
hidden = false;
}
message = "height: " + $("#blam").css("height");
message += "\nwidth: " + $("#blam").css("width");
alert(message);
});