有没有办法知道如何使用开发人员工具设置内联css属性值?

时间:2016-02-05 17:01:44

标签: javascript google-chrome-devtools

我在基于javascript的布局上遇到了不好的时间,所以我想知道是否有一种方法,例如,使用Chrome开发工具,知道哪一行JS设置了我的元素&# 39; s宽度。铬能够检测到吗?

2 个答案:

答案 0 :(得分:2)

在Chrome开发者工具的“来源”标签下,您可以将执行设置为暂停DOM突变。 Here is the link to the relevant section of the documentation

enter image description here

答案 1 :(得分:1)

由于内联CSS属性更改实际上会修改元素" s"样式"属性,你也可以打破元素的属性修改(在Elements面板中,右键单击一个元素并选择Break on... -> Attribute Modifications)。