nbieber/mckayla — pull request #6 by structAnkit (2012-10-03 23:04:56+00:00)
Title: Resizing fixes, click-to-hide, refactoring

Hey Nicole; I couldn't reach you on Twitter but found you on Github. This is just a pull request that refactors your code a bit to solve a few issues:

1. Resizes McKayla properly so she doesn't eat up the entire page in many situations
All I did was set the width where your code only set the height for the image (and vice-versa). This forces the image to be of the correct size instead of relying on auto-sizing and aspect ratio consistency calculations (which were blowing McKayla up instead of sizing her down due to the dimensions of the original image).

2. Adds click-to-hide funcitonality
Self-explanatory; individual McKayla instances can now be dismissed if left clicked. This was causing issues when I really needed to see an image (i.e. placed over a Fork me on Github! image or a UPS shipping label...yes I've printed McKayla once by accident)

3. Refactored the code, creating a McKayla object prototype that handles all the calculations and such so your document.onReady only has to focus on finding the image you want to overlay and creating a McKayla instance for it.

Let me know what you think.