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