问题描述
我正在尝试查找仅在IE9中更改属性的高度/宽度的内容.
I'm trying to find what is changing the height/width of an attribute in IE9 only.
有一个Firebug功能属性更改中断" https://getfirebug.com/wiki/index.php/Break_On_ ...
There is a Firebug feature "break on attribute change"https://getfirebug.com/wiki/index.php/Break_On_...
我已经在代码中包含了firebug-lite脚本. https://getfirebug.com/firebuglite
I've included the firebug-lite script in my code.https://getfirebug.com/firebuglite
但是,右键单击firebug lite中的一个元素并不会弹出上下文菜单:(
But right clicking on an element in firebug lite doesn't bring up the context menu unfortunately :(
firebug lite是否支持打破属性更改"?
Does firebug lite support "break on attribute change"?
还是有替代方法?
谢谢,罗斯
推荐答案
哇!了解了当属性通过更改时如何显示消息 http://help.dottoro.com/ljdchxcl.php
Woohoo!! Found out how to display a message when the attribute changes viahttp://help.dottoro.com/ljdchxcl.php
<body onload="InitListener ();">
....
<script type="text/javascript">
function InitListener () {
var elemToCheck = document.getElementById ("objectelementid");
if (elemToCheck.addEventListener) {
// all browsers except IE before version 9
elemToCheck.addEventListener ('DOMAttrModified', OnAttrModified, false);
// Firefox, Opera, IE
}
if (elemToCheck.attachEvent) {
// Internet Explorer and Opera
elemToCheck.attachEvent ('onpropertychange', OnAttrModified);
// Internet Explorer
}
console.log("events attached");
// Test the event works
elemToCheck.setAttribute("width","333");
console.log("something happened");
}
function OnAttrModified (event) {
var message = "";
if ('attrChange' in event) {
// Firefox, Opera, Internet Explorer from version 9
message += "Something has happened to an attribute of the " +
event.target.tagName + " element.\n";
message += "The value of the " + event.attrName +
" attribute has been changed from "
+ event.prevValue + " to " + event.newValue + ".";
}
if ('propertyName' in event) { // Internet Explorer
message = "The " + event.propertyName + " property of the "
+ event.srcElement.tagName + " element has been changed.";
}
console.log(message);
}
</script>
不幸的是,该测试没有用,如果没有宽度或高度,IE9似乎会自动调整视频的大小...必须是功能...深深的欢乐...
Unfortunately, the test provide futile, it seems that IE9 automatically resizes the video if there is no width or height... must be a feature... deep joy...
这篇关于Firebug Lite-中断属性更改-IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!