如何使用javascript获取高度/宽度(或其他属性)

时间:2014-06-15 00:55:33

标签: javascript jquery html

使用jquery-ui resizable更改div元素的高度/宽度(或其他css属性)后,如何获取新属性并保存

1 个答案:

答案 0 :(得分:0)

您可以为stop事件添加处理程序。根据 jQuery UI API documentation

$( ".selector" ).resizable({
  stop: function( event, ui ) {
      ui.size;  //The current size represented as { width, height }
      ui.originalSize; //The size represented as { width, height } before the resizable is resized
  }
});