I want to see the CSS transition or JavaScript/jQuery animation assigned to a particular element. How should I do it in Chrome DevTools or any other developer tools?
For instance, I visited a Google plus page and I noticed that when I hover on an image it grays out, zooms in and a close button appears in the corner.
Normal:
Hover:
How can I see the code behind this behavior?
I want to see the CSS transition or JavaScript/jQuery animation assigned to a particular element. How should I do it in Chrome DevTools or any other developer tools?
For instance, I visited a Google plus page and I noticed that when I hover on an image it grays out, zooms in and a close button appears in the corner.
Normal:
Hover:
How can I see the code behind this behavior?
Share Improve this question asked Apr 12, 2013 at 9:05 JonasJonas 1571 silver badge7 bronze badges4 Answers
Reset to default 5Right click on the html elements in elements tab and select :hover options. Now you can see the hover css applied to the particular elements in right-hand side styles tab. Pls refer screen shot
For css transitions, its easy to spot when using the chrome dev tools. Just right click on the animation you want to view bring up the inspector. Change the state of the element to hover and you can view all the css for the hovered element.
For javascript, you can use the Resources tab in the chrome dev tools to view what scripts fires.. Just go through it.
For your effect.. its most probably Javascript.
they will register a Hover event. a hover event can be added by various methods
in CSS
#someId:hover { color:red; }
in Jquery.
$('#someid').hover();
via Unobtrusive jquery. they will attach events in unobtrusive manner
now check for the view source for this method. some where they will attach the events.
There is no easy way with JavaScript as far as I know, but the following is my favorite answer and method when I'm working on css in Chrome., you can force states and inspect hover css etc.
https://stackoverflow./a/6778547/941896