Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebug: How to inspect elements changing with mouse movements?

Sometimes I need to inspect elements that are only showing up on a page if you put mouse over some area. The problem is that if you start moving mouse towards firebug console in order to see the changes, mouse-out event is triggered and all changes I am trying to inspect disappear. How to deal with such cases?

Basically I am looking for something that would either:

  • Switch to firebug console without moving a mouse (using keyboard shortcuts maybe? But I can't figure out how to use firebug with keyboard only)
  • Have an ability to "freeze" the page so your mouse movements don't trigger any events anymore.

Thanks.

like image 408
serg Avatar asked Nov 04 '09 17:11

serg


People also ask

How can I inspect an element which disappears when my mouse moves away?

Just go to Sources-> Event Listener Breakpoints-> Mouse-> mousedown in Chrome.

How do I inspect element with mouse?

Go to the Sources tab of your DevTools, expand the Event Listener Breakpoints section to the right, expand Mouse and check the mouseover box. Then, put the mouse over your link: the debugger will stop in the JavaScript function that modifies the style of your link.

How do I inspect the hover element in Firefox?

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.

How do I inspect element in Chrome without right clicking?

Press CMD + Option + I on a Mac, or F12 on a PC to open Inspect Elements without clicking anything.


2 Answers

HTML Tooltip (Firebug)

Select the element with the inspector or in the DOM. Go to the "Styles" tab in firebug and click to the small arrow on the tab and select ":hover" (also available ":active"). The state will remain on "hover" and you can select other elements to make them hover.

HTML Tooltip (Firefox developer tools)

enter image description here

Click the button to see three checkboxes, which you can use to set the :hover, :active and :focus pseudo-classes for the selected element

This feature can also be accessed from the popup menu in the HTML view.

If you set one of these pseudo-classes for a node, an orange dot appears in the markup view next to all nodes to which the pseudo-class has been applied:

enter image description here

JQuery Tooltip

Open the console and enter jQuery('.css-class').trigger('mouseover')

Regular Javascript Tooltip

Open the console and enter document.getElementById('yourId').dispatchEvent(new Event('mouseover'));

like image 74
Stefan Avatar answered Oct 08 '22 11:10

Stefan


The style panel in Firebug has a dropdown menu where you can choose the :active or :hover state.

enter image description here

like image 42
david.s Avatar answered Oct 08 '22 10:10

david.s