tags:

views:

32

answers:

1

Is this possible? I have this right now for my fancybox:

    $(document).ready(function() {
       $("a#uploadImage").fancybox({
    'titleShow'     : false,
    'width':    560,
    'height':   620,
    'autoDimensions': false,
    'overlayOpacity': 0.6
       });
    });

Is it possible to later on to do:

    $(document).ready(function() {
       $("a#uploadImage").fancybox({
    'onCleanup' : function() {
if (window.confirm('Är du säker?')) 
    {
    alert ('OK!');
        }else{
    return false;
        }
    }
       });
    });
+3  A: 

This plugin in particular stores it's options in .data() as an object, so you can do this:

$("a#uploadImage").data('fancybox').onCleanup = function() {
  if (window.confirm('Är du säker?')) {
    alert ('OK!');
  } else {
    return false;
  }
};
Nick Craver