WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. murteiranabo
    Member
    Posted 1 year ago #

    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() {
    scrollpage();
    $("body .video").css({ display: "block" }); //show video on close
    }),

    Thank you very much.

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

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

    stuff...

  3. murteiranabo
    Member
    Posted 1 year 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