9. March 2011 22:07by JP Hellemons
There is a nice jQuery plugin called imgpreview.
It’s from James Padolsey. He made it back in 2009 and you can read more about it on this page:
This is the demo page: http://james.padolsey.com/demos/imgPreview/full/
It’s really easy to use. Your HTML should look like:
And the jQuery is:
So when you hover the anchor (a) link text, it will popup the image referenced in the href. So far so good. But when you have dynamic pages and there might not be a selected element, you will receive an error. As noted by Françoise, it’s a (minor) bug.
So therefor I have made a minor adjustment and will share a small updated version of the plugin from James Padolsey which will fix the “a is undefined” error in imgpreview.
By the way, I have used http://jscompress.com/ to minify the source again.