Here is the javascript used....
It works but sometimes it takes a bit to fire so the browser has horizontal scrollbars. When the js kicks in sometimes the browser will snap back and sometimes it wont. Seems hit or miss with all browsers.
I tried putting max-width:90% on my image class but then the js grabs the css adjusted width so it doesn't resize any images.
So the $64 question is, is there any way to tweak this js to force it to grab the native width instead of the CSS adjusted width? That should solve the problem.
I've googled and played with this off and on for days with no luck.