Shadowbox Plugin - Videos & Images in Lightbox

Posted by Vishal on September 24th, 2011

Recently I had to show Videos & Images in a Lightbox. A year back I had shown Videos with Lightbox using FancyBox, but that was not a very clean approach. So this time I decided not to use that & try something better.

I found out about Videobox. It is built only to show Videos in a lightbox. I tweaked it to also show images. It was working fine until I tested it in IE 8. Later I found out that this is an outdated lightbox application & the last known updated to it was in 2007. When I heard this, I abandoned it at that very moment.

The next I found was Shadowbox.js. The integration was very simple & at the same time, compatible across all browsers. It was up & running in 5 mins. Wow! Along with a free version, it also has a commercial license.

image setAttribute() does not work in IE 8

Posted by Vishal on September 22nd, 2011

Blogging after almost 10 months…Whew…long time!

Today I was trying to resolve an issue wherein an image was being displayed dynamically, but it wasn’t visible in it’s proper width & height only in IE 8.  The height & width were being set by:

img.setAttribute(”width”,”50px”);

img.setAttribute(”height”,”50px”);

It didn’t take much time to resolve this issue. The issue was that IE 8 (Not sure of other versions) didn’t like the above method of setting the width & height. Instead, I had to use the below:

img.style.width = “50px”;

img.style.height = “50px”;

This worked like a charm in all browsers.


Copyright © 2007 Vishal Kothari. All rights reserved.