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?
Prepare by opening devtools and setting it open in a separate window (whilst in devtools, open the palette by using ctrl or cmd + p - then type >undock) Now focusing on the browser window again, hover over the triggering element and leave the mouse pointer where it is.
Click on the element inside the element inspector. Move your mouse over the element, press the up arrow key and then the down arrow key. You'll see the hover properties.
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:
Note the shortcut to pause script execution—F8.
Interact with the UI to get the element to appear.
If the hover
effect is given with CSS
then yes, I normally use two options to get this:
One, to see
the hover effect
when the mouse leave the hover area
:
Open the inspector in docked window and increase the width until reach your HTML element
, then right click and the popup menu must be over the inspector zone... then when you move the mouse over the inspector view, the hover effect
keep activated in the document.
Two, to keep
the hover effect
even if the mouse is not over the HTML element
, open the inspector, go to Styles TAB
and click in the upper right icon that says Toggle Element State
...(dotted rectangle with an arrow) There you can manually activate the Hover Event
(among others) with the checkbox provided.
If it's not clear at all, let me know and I can add a few screenshots. Edited: screenshot added.
And finally and as I say at the begining, I only be able to do this if the hover
is set with CSS:HOVER
... when you control the hover state
with jQuery.onMouseOver
for example, only works (sometimes), the method One.
Hope it helps.
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