Google-chrome – “Inspect” a hover element

google-chromegoogle-chrome-devtools

Note: I've read similar threads, but none quite my issue – I can right click on it fine, it just then disappears.

I find "Inspect Element" an invaluable tool in Chrome, however my latest foray as I learn the wizardly ways many of you already possess saw me creating a sub-menu for an element on my nav bar, which pops up below on hover of it's parent item.

The popup(or down) isn't quite styled how I'd like, so I right-click > inspect element to see what's coming from where exactly, and get a better idea of how to achieve my desired effect.

However, as soon as I move my mouse away from the menu, it's gone.

So I can't select different elements in the inspection pane, and see which area is highlighted at the same time.

Is there a way around this, without changing the menu so that it stays "popped up" once activated?

Best Answer

If the hover is triggered by JS, just pause script execution via the keyboard. This is a much simpler way of freezing the DOM than the other answers suggest.

Here's how you do it in Chrome. I'm sure Firefox has an equivalent procedure:

  1. Open up Developer Tools and go to Sources.
  2. Note the shortcut to pause script execution—F8.

    Pause script execution

  3. Interact with the UI to get the element to appear.

  4. Hit F8.
  5. Now you can move your mouse around, inspect the DOM, whatever. The element will stay there.