Shadowbox and javascript controlled links

Reading time ~1 minute

Recently I have started using Michael J. I. Jackson’s Shadowbox.js on some of my client’s sites. On site in particular had an image gallery where you could click on a thumbnail to view a larger version of the image, and some had associated videos as well.

The goal there was to have a single link that would be updated to point to the correct flash video depending on the thumbnail being clicked (the link being hidden if no video was associated with that thumbnail). After a few frustrated minutes, I discovered that Shadowbox.setup() needs to be called after changing the link’s href attribute so that the link will trigger the correct video. Since the initially the link didn’t point to a video at all, I also passed {skipSetup: true} to Shadowbox.init().

Tin Khan

After five months of working at Saltbox in early 2012, funds ran out. I seriously considered taking a gamble with a work-for-equity offer...… Continue reading

A Comeback for Another Drink

Published on September 25, 2016

Fanonic Update

Published on July 26, 2012