Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<div id="san">
    <div id="block1" >
    </div>
    <div id="block2">
    </div>
</div>
 
#san {
    background-color: red;
    text-align: center;
    height:300px;
    width:400px;
}
#block1{
    position:relative;
   top:20px;
    background-color:green;
    height:100px;
    width:100px;
}
#block2{
    position:relative;
   top:40px;
    background-color:violet;
    height:100px;
    width:100px;
}
 
<script type="text/javascript">{
  $("block1").mouseenter(function() {
    $("san").css("background", "#F00").css("border-radius", "3px");
}).mouseleave(function() {
     $(san).css("background", "00F").css("border-radius", "0px");
});
</script>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers