tags:

views:

35

answers:

1

is there is any way to get the width and height of a resizable div while resizing i try the following code but it resulted as undefined in alert box i am using jQuery resizable

$("#msc_div").resizable({
     start: function() {
        var offset = $(this).offset();
        alert(offset.height);
        alert(offset.width);
     }
});
+6  A: 
$("#msc_div").resizable({
    start: function() {

        var t = $(this);

        alert( t.height() );
        alert( t.width() );

    }
});

See:

J-P
+1 One of the most extensive answers I've seen so far (at least from the ones having the jQuery tag).
MvanGeest
@shahul - The properties you get from `.offset()` are the `top` and `left` positions calculated relative to the document. As J-P demonstrated above, separate methods are required for `width` and `height`.
patrick dw