Julian Xhokaxhiu
Julian Xhokaxhiu
DevOps Engineer - Cloud Architect - Solution Architect - Platform Engineer - Open Source Enthusiast
Jan 12, 2011 1 min read

ContentFlow Shadowbox plugin

Hi there,

for all you guys who knows already what ContentFlow is and what ShadowBox is, this is for you! (but this is also for you, if you don’t know what they are,  just visit their respective websites). What does it do? Simply, inspired by the LightBox plugin, this does just the same, but with Shadowbox, so when you click on an active item and on it’s image link, it just open it on Shadowbox without leaving your page. And what about the title? Yeah it does get it also.

Remember to include this script AFTER ContentFlow, which it have to be AFTER Shadowbox (otherwise it won’t work).

Enjoy!

/*  ContentFlowAddOn_shadowbox, version 0.1
 *  (c) 2011 Julian Xhokaxhiu
 *
 */
new ContentFlowAddOn('shadowbox',{
    ContentFlowConf:{
        onclickActiveItem: function (item){
            if (item.content.getAttribute('src'))
        Shadowbox.open({
            player:'img',
            title:(item.caption)?item.caption.firstChild.nodeValue.replace(/]*>/,': '):'',
            content:item.content.getAttribute('src')
        });
        }
    }
});