开发者

contenteditable: trigger event on image resize when using handles

Just in firefox i want to trigger an event whenever the size of an image is changed.

Wh开发者_StackOverflow中文版en you click an image in a contenteditable area firefox gives it handles and you can adjust the size, as soon as the mouseup is done i want to trigger an event so i can get some information from the image, the rest is easy, i just cant find something that fires off when the handle is dragged and let go on the image.

Im guessing something in jquery could monitor the div using the live function.


You may observe the DOMAttrModified-event:

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜