就在 firefox 中,我想在图像大小改变时触发一个事件。
当您在内容可编辑区域中单击图像时,firefox 会为其提供句柄并且您可以调整大小,一旦完成 mouseup 我想触发一个事件以便我可以从图像中获取一些信息,剩下的很容易,我只是找不到在拖动 handle 并放开图像时触发的东西。
我猜测 jquery 中的某些东西可以使用 live 函数监视 div。
最佳答案
您可能会观察到 DOMAttrModified -事件:
editableDivNode
.addEventListener ('DOMAttrModified',
function(e)
{
if(e.target.tagName=='IMG'
&& e.target.getAttribute('_moz_resizing')
&& e.attrName=='style'
&& e.newValue.match(/width|height/))
{
//do something here but don't prompt the user
}
},
false);
关于javascript - contenteditable:使用句柄时图像调整大小触发事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7034485/