Skip to content

Instantly share code, notes, and snippets.

@mo7amd
Created March 20, 2017 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mo7amd/08ca0f635bc110120b71e7ad03e161f3 to your computer and use it in GitHub Desktop.
Save mo7amd/08ca0f635bc110120b71e7ad03e161f3 to your computer and use it in GitHub Desktop.
$('child').hide();
$('parent').mouseover(function(){
$(this).find('child').show();
anchor_hover();
}).mouseout(function(){
anchor_hover();
$(this).find('child').hide();
});
function anchor_hover() {
$('child').mouseover(function() {
$(this).next('parent').show();
}).mouseout(function() {
$('child').hide();
});
}
// ********************************************
//**************** html structure ************************
<ul>
<li (parent)>
<div (child)>
</div>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment