Line clamping, as jQuery plugin and standalone