Take the below snippet of a menu which shows a dropdown on hover:
$('#menu').hover(
function() {
$('#dropdown').show();
}, function() {
$('#dropdown').hide();
}
);
#menu {
width: 100px;
background-color: #03f;
color: #fff;
padding: 2px 5px;
}
#dropdown {
width: 100px;
background-color: #03f;
color: #fff;
padding: 2px 5px;
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="menu">menu</div>
<div id="dropdown">
<ul>
<li>menu item 1</li>
<li>menu item 2</li>
<li>menu item 3</li>
</ul>
</div>
Copy this snippet into a local document, as Chrome Dev Tools will not allow you to use Javascript to select any element in this iframe. Then, in your Dev Tools Console, run:
$('#menu').trigger('mouseover');
This will show the dropdown menu, which has a really ugly, unstyled list. Now, instead of using your mouse to right-click the element and selecting "Inspect Element", which I would imagine is how your're used to doing things, run in your Console:
$('#dropdown');
Or whatever selector for whichever element you want to style/manipulate. The Console will show the result of your statement, which is the relevant jQuery object. Now right click on that object in your Console and select Reveal in Elements Panel. Now you can use the Styles tab as you're used to, and your mouse has never triggered the mouseout
event, ending the hover.