How do you debug vanishing elements with Firebug/Dev Tools on your websites?
I have a div that disappears on mouseleave/out; I would like to explore this div with the debugger, but on my way to the firebug/debugger window, the div I want to inspect disappears.
Does anyone have tricks to achieve this?
EDIT: - It's not marked display: none, but removed from the DOM. Making this a bit challengier to find , if it's gone :-)
Reference this jsFiddle for an example of vanishing nodes on mouseout.
Note that some of the other answers won't handle/catch iFramed content. These two methods will...
As the OP said, the easiest way, to catch these elements, is to use firebug's Break On Mutate function.
Another easy alternative is just to save the file:
While hovering over the appropriate element with the mouse...
Press ControlS. The "Save As" function saves the generated code.
For sites that override ControlS, such as jsFiddle, press AltF, then A (On Windows machines, anyway).
Open the saved code and you can see the fleeting element(s) there. iFramed content will be in the _files subfolder.
To debug vanishing element with DevTools, you can easily break on subtree & attributes modifications or node removal by selecting the element and in context menu select 'Break on...' (as shown below).
Alternatively you may try Visual Event or Visual Event 2 which can show you debugging information about events that have been attached to DOM elements. See: How to find event listeners on a DOM node?
Extra points if you use Ctrl + F to find it!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With