如何检测CSS3调整大小事件 [英] How to detect CSS3 resize events

查看:124
本文介绍了如何检测CSS3调整大小事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS3 resize属性可以分配给任意元素。我正在寻找一种方法来检测这样的调整大小,说,divs(我不介意它只工作在FF的时刻):

The CSS3 resize property can be assigned to arbitrary elements. I'm looking for a way to detect such a resize on, say, divs (I don't mind it only working in FF at the moment):

div {
  resize: horizontal;
  overflow: hidden;
}


$ b $ p

不幸的是, onresize 事件似乎没有被触发的div。如何在JavaScript中检测到此类用户实例化调整大小时发生了什么?

Unfortunately, the onresize event seems not to be fired on the div. How can I detect in JavaScript when such a user-instantiated resize has happened?

编辑: FWIW我在Mozilla 。如果您要跟踪: https://bugzilla.mozilla.org/show_bug.cgi?id=701648

FWIW I had opened a bug report over at Mozilla. If you want to track it: https://bugzilla.mozilla.org/show_bug.cgi?id=701648

推荐答案

聆听 DOMAttrModified events 。从此答案, a href =http://jsfiddle.net/robertc/r2NFT/>这个jsFiddle 似乎在Firefox 8中工作(如果你打开控制台)。

Listen to DOMAttrModified events. Got the idea from this answer, this jsFiddle appears to work in Firefox 8 (if you open the console).

这篇关于如何检测CSS3调整大小事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆