Fancybox onComplete function not running
fancybox, jquery
Solution
I guess you forgot to specify what version of fancybox you are using.
`onComplete` is a callback option for fancybox v1.3.x while the `fancybox-skin` class was introduced until version 2.x, ..... so I assume that you are using version 2.x, aren't you?
Fancybox v2.x options are new and not compatible with previous versions; the equivalent for the `onComplete` (v1.3.x) option is now the `afterLoad` (v2.x) callback option.
Check http://fancyapps.com/fancybox/#docs for the complete list of options, methods and callbacks for fancybox v2.x
Problem
For some reason it's just not running the `onComplete` function. It does however load the fancybox div. My html: ``` <ul> <li class="orange"> #1 <a href="#text">click here</a> <div id="text" class="text">text text text</div> </li> </ul> ``` My jquery: ``` jQuery('li a').fancybox({ 'autoDimensions': 'false', 'width' : 631, 'height': 256, 'onComplete':function(){ alert('running'); jQuery('.fancybox-skin').css('background-color',colour); } }); ``` the alert doesn't run. I've also tried changing the event function to `onClosed` and the other events, and nothing.