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 E开发者_StackOverflow社区lement" 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?
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:
- Load the page
- activate FireBug's HTML panel
- Locate the
body
element - Right-click on the
body
element and chooseBreak on Child Addition or Removal
from the popup menu - Go hover over your photo to trigger the wanted element's creation
Script 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.
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.
Can you search for the element using the search bar at the top of the firebug window?
You can use CTRL+F to find it in the code view.
精彩评论