convert affixing code to jquery.pin.js