adamdbradley/foresight.js — pull request #9 by jmuthad (2012-04-16 21:17:05+00:00)
Title: Feature Suggestion

Hello,

I made some modifications to solve a problem I was having and wanted to share them globally. This library is great but I found it didn't solve my problem where I needed to have different size images for different size browsers and could only return one HTML. I solved this by adding a "max-width" unit type that you could specify by setting the width on the img element to max-width. It would then use the max-width from the computed value so that it can use CSS styles to specify the value.

I setup an example on jsfiddle although it doesn't seem to fully work on resize there (initial size seems to work correctly though). I assume it has something to do with the CSS and I expect if you included the full contents in a local file you would find it to work fully.

http://jsfiddle.net/jmuthad/RcZ4J/

I look forward to hearing if you have any suggestions or comments and hope you would like to include the change in the master revision. I started out trying to setup events to hook in but ended up not needing them, I figured since I already did the work though I would include it in this pull request as well.

Thanks,
Thad