Use like:

POC: http://jsfiddle.net/moagrius/4L31fxoy/1/