<script src="//code.jquery.com/jquery-2.1.0.min.js"></script>

<div id="box" class="shadow-0">
    Click Me!
</div>
#box {
    font-family: Consolas;
    margin: auto;
    margin-top: 50px;
    width: 100px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    vertical-align: middle;    
}
.shadow-0 {
    /* border: 1px solid #eee; */
    box-shadow: 0 0 1px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .1);
}
.shadow-1 {
    box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16), 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.shadow-2 {
    box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.19), 0 8px 17px 0 rgba(0, 0, 0, 0.2);
}
.shadow-3 {
    box-shadow: 0 17px 50px 0 rgba(0, 0, 0, 0.19), 0 12px 15px 0 rgba(0, 0, 0, 0.24);
}
.shadow-4 {
    box-shadow: 0 25px 55px 0 rgba(0, 0, 0, 0.21), 0 16px 28px 0 rgba(0, 0, 0, 0.22);
}
.shadow-5 {
    box-shadow: 0 40px 77px 0 rgba(0, 0, 0, 0.22), 0 27px 24px 0 rgba(0, 0, 0, 0.2);
}
var $box = $('#box');

var index = 0,
    step = 1,
    end = 5,
    min = 0,
    max = 5;

$box.click(function () {
    $box.removeClass('shadow-' + index);
    index += step;
    $box.addClass('shadow-' + index);

    if (index === end) {
        if (step > 0) end = min;
        else end = max;
        step = -step;
    }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.