danmillar/jquery-anystretch — pull request #4 by georgiee (2012-08-02 16:32:28+00:00)
Title: Scale aware offsets for centered version added. {offsetX:-216,offsetY:-108}

Working on a responsive website I need the ability to shift the center by some pixels for each breakpoint. Now I can use anystretch for this.
Thanks for the script. There was one feature missing: Offsets for the centered behavior. I didn`t find any pull or change for this so I created it myself.

$.anystretch("full.jpg",{
offsetX:-216,
offsetY:-108
});
See demo in examples/demo-fullscreen.html

Offsets are always relative to the center of the full sized image but
aware of the current scaling. So a point at (100,50) from the center
gets projected to (200,100) from the center if the image is scaled
twice. The scale algorithm is simplified and more general now. As I
didn`t care for the left/right aligned versions I have not included
them for now.