Skip to content

Instantly share code, notes, and snippets.

@Zillionx
Created February 22, 2015 03:01
Show Gist options
  • Save Zillionx/b36fac0cddefa85fd26e to your computer and use it in GitHub Desktop.
Save Zillionx/b36fac0cddefa85fd26e to your computer and use it in GitHub Desktop.
Dim the rest when on mouseover div
<html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<div id="parent">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>
/* Dim the rest when on mouseover */
body{
background:#889;
}
#parent > div{
float:left;
padding:10px;
background:#eee;
width: 150px;
height:100px;
margin:8px;
box-shadow: 0 1px 2px #334;
-webkit-transition:1.8s;
transition:1.8s;
}
/* fade ALL out on parent hover */
#parent:hover > div{
opacity:0.6;
}
/* fade ONE in on hover */
#parent > div:hover{
opacity:1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment