Easy FancyBox
Adding functions to onComplete, onStart, onClosed, etc. (3 posts)

  1. murteiranabo
    Posted 3 years ago #

    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.


  2. RavanH
    Plugin Author

    Posted 3 years ago #

    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" });


  3. murteiranabo
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic