简体   繁体   English

Firebug Lite-中断属性更改-IE

[英]Firebug lite - break on attribute change - IE

I'm trying to find what is changing the height/width of an attribute in IE9 only. 我试图找到仅在IE9中更改属性的高度/宽度的内容。

There is a Firebug feature "break on attribute change" https://getfirebug.com/wiki/index.php/Break_On_ ... 有一个Firebug功能“打破属性更改” https://getfirebug.com/wiki/index.php/Break_On_ ...

I've included the firebug-lite script in my code. 我在代码中包含了firebug-lite脚本。 https://getfirebug.com/firebuglite https://getfirebug.com/firebuglite

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"? firebug lite是否支持“属性更改中断”?

Or is there an alternative method? 还是有替代方法?

Thanks, Russ 谢谢,拉斯

Woohoo!! oo! Found out how to display a message when the attribute changes via http://help.dottoro.com/ljdchxcl.php 通过http://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>

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... 不幸的是,该测试没有用,似乎IE9在没有宽度或高度的情况下会自动调整视频的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM