Functions inside functions

e.g. Function inside of mouseenter, mousenter inside of a function. Source: http://www.codecademy.com

by clarusdignus

HTML

<div><strong>Click Me!</strong></div>

CSS

div {
    line-height: 60px;
    width: 100px;
    border-radius: 5px;
    background-color: #69D2E7;
    text-align: center;
    color: #FFFFFF;
    font-family: Verdana, Arial, Sans-Serif;
    opacity: 0.5;
}

JavaScript

$(document).ready(function(){
    $("div").mouseenter(function(){
        $("div").fadeTo("fast", 1);
    });
    $("div").mouseleave(function(){
        $("div").fadeTo("fast", 0.5);
    });
});