Firebug:如何检查无法单击的元素?
我正在尝试使用 Firebug 检查将鼠标悬停在照片上时出现的页面元素。
问题是,元素的位置与鼠标位置动态偏移,因此我不可能右键单击它来获取“检查元素”选项。
我曾希望将 onhover 元素插入到 DOM 中一个合理的位置,但到目前为止,我还没有找到它。
有什么建议吗?
I'm trying to use Firebug to inspect a page element that appears when I hover over a photo.
Problem is, the element's position is dynamically offset from the mouse position, so it's impossible for me to right-click on it to get the "Inspect Element" option.
I had hoped that the onhover element would be inserted into the DOM in a sensible place, but so far, I haven't been able to find it.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您知道新元素将在 DOM 中的哪个位置创建(这些元素通常是作为
body
元素的子元素创建的),您可以设置一个断点被创建。我们假设该元素将被创建为
body
元素的子元素。如果按照以下步骤操作,您将能够检查该元素:body
元素body
元素并选择从弹出菜单中中断子级添加或删除
一旦创建了元素,脚本执行就会中断。那时,您将有足够的时间检查动态创建的元素,甚至在 HTML 面板中也是如此。
If you know where in the DOM the new element will be created (quite often those elements are created as children of the
body
element) you can set up a breakpoint for when it is created.Let's assume that the element will be created as a child of the
body
element. You will be able to inspect the element if you follow these steps:body
elementbody
element and chooseBreak on Child Addition or Removal
from the popup menuScript execution should then break as soon as the element is created. At that point you will have all the time you need to inspect that dynamically created element, even in the HTML panel.
这不是一个理想的解决方案,但您可以研究悬停代码以查找有关正在创建的元素的更多信息。该信息可能允许您在 Firebug 的 DOM 查看器中找到它。
This isn't an ideal solution, but you could investigate the onhover code to find out more information about the element that's being created. That info might allow you to find it in Firebug's DOM viewer.
您可以使用 Firebug 窗口顶部的搜索栏搜索该元素吗?
Can you search for the element using the search bar at the top of the firebug window?
您可以使用 CTRL+F 在代码视图中查找它。
You can use CTRL+F to find it in the code view.