0

I was wondering if there is a way to get the height of an element when using jQuery's show('scale')

CSS:

    #elementid {width:500px;height:500px;}

JAVASCRIPT:

$('#elementid').show('scale');

alert($("#elementid").height());//This displays "1", instead of "500"
user2472523
  • 113
  • 1
  • 2
  • 6
  • Here are some more details: In this [working example](http://jsfiddle.net/FG9pG/33/), you can see that getting the height after a regular show() works fine. However, when using jQuery UI's show('scale'), the height return is "0", possibly due to a delay? LINK: http://jsfiddle.net/FG9pG/33/ – user2472523 Jun 15 '13 at 07:10

2 Answers2

0

Try

$('#elementid').click (function () {
    alert($('#elementid').height());
});

WORKING DEMO

If the Div is intially Hidden see here.

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

After a bit of research, I was able to find the answer to my question:

$('#elementid').show("scale", function()
{
    alert($("#elementid").height());
});

The same principal can be used for other animation effects such as slideDown, etc.

user2472523
  • 113
  • 1
  • 2
  • 6