I’m having some difficulty with pop up images in JQuery.
Here’s a link to the working code:
http://jsfiddle.net/aETbw/27/
If you hover over the little camera icon a photo pops up.
I’d like the pop up image to stay within the viewport, where the viewport is large enough.
You have to check to make sure the image popup and it’s offset isn’t wider than the content area. If it is then position the image popup right vs left. You can’t get the true width of the image popup until after the actual image is loaded. Once it is loaded then run your width check.
See the new fiddle here:
http://jsfiddle.net/iambriansreed/UBpep/
UPDATE
I updated my answer to meet the new requests in the comments. The fiddle link above is updated as well.