试了几种方法包括有资料说的h5新特性,都没能满足我的需求。我的需求如下:
元素高度是动态可变的,比如可拖动teatarea元素
最后用到了指针监听事件解决了
$(document).mousemove(function(e){
//这一块处理页面高度
});
示例:
$(document).mousemove(function(e){ var height=""; $($("body div").children()).each(function(index,item){ height+=$(item).height(); }); $('#replaceContent', parent.document).height(height); });