See the Pen behavior-api-custom-example-4 by soritesparadox (@soritesparadox) on CodePen.