Support » Plugin: Easy FancyBox » Adding functions to onComplete, onStart, onClosed, etc.

  • Hi,
    I’m pretty new at jQuery and I’m having a lot of problems trying to add some extra functions to the Easy Fancybox plugin.
    Where would I put these, and what’s missing?

    ‘onStart’ : (function(){
    $(“body .video”).css({ display: “none” }); //hide video on open

    ‘onClosed’ : (function() {
    $(“body .video”).css({ display: “block” }); //show video on close

    Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RavanH


    Hi, adding these parameters to FancyBox would mean you have to edit the plugin files. Your changes will be overwritten and lost on the next update.

    It would be better to create a stand-alone jQuery script snippet that detects clicks on any media links on your site (that open up in FancyBox) and then fire that

    $(".video").css({ display: "none" });


    Thanks for replying.

    I find that alternative more complicated for me since I wouldn’t know how to undo those functions when Fancybox closes.

    I know I’d lose those changes when updating the plugin, but I wasn’t even able to add anything to the onStart and onClose since they’re within an array.

    Spent hours searching and didn’t find any other alternatives.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding functions to onComplete, onStart, onClosed, etc.’ is closed to new replies.