shadowbox library doesn't work with durandal

46 Views Asked by At

I am working with durandal, and I am using shadowbox plugin "http://shadowbox-js.com/" to view image in a popup

to make it work according to shadowbox documention I have to call: Shadowbox.init();

so I added it in attached event, but it doesn't work 'may be because the images are not loaded yet'

any solution to make it work??

2

There are 2 best solutions below

0
On

Try using the composition complete lifecycle callback. See here for more information: http://durandaljs.com/documentation/Hooking-Lifecycle-Callbacks.html#combined-lifecycle

0
On

Everything works with Durandal. Durandal has nothing to do with it. What you should do is download Shadowbox's jQuery adapter. That approach is more appropriate under Durandal. Take a look at the link here.

Once you have the jQuery adapter in place, writing a quick custom Knockout binding is a breeze. Then, you can call upon Shadowbox declaratively, in your HTML, using the viewModel to configure it.