• It would be great if you added an option to have the Easy Fancy Box scripts and code loaded in the footer instead of in the head. It is a TON of code before the page content and it really effect the page load times.

    It also might be much better to call the javascript in a .js file and the css in a .css instead of all directly in each and every page. This would also aid in page load because browsers would auto cache it.

    Thanks,

    M Aronoff

    https://wordpress.org/plugins/easy-fancybox/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Michael, the code that is loaded in the head section may look like much but it is only the parameters. The actual work is done in the footer where the core script, easing, mousescroll and metadata extensions (if needed) are loaded. And after all that, last but not least the fancybox is fired up, again in the footer.

    If you want to reduce impact on load time, then consider turning OFF all media types you do not need. Also minimizing options like auto-detect and easing effects (set to fade) will help page speed.

    Thread Starter Michael Aronoff

    (@masterk)

    OK, I see what you mean.

    I have turned off all media except what I need and turned off transitions. That helps a little but it still seems to me that putting the css and javascript that are called in the head would be cached better (and that really matters on a site with MANY pages) if you placed them in external files and then called them. This would really tighten up the code and is really best practice.

    Please consider it at some point.

    Thanks,

    M Aronoff

    The CSS in the head are mostly IE6/7/8 specific rules and are there because old IE needs full paths.

    I used to have the css in an external stylesheet but that needed to be a dynamic stylesheet, which in turn is even heavier because each request would mean another instance of PHP. Among other issues that came along with that approach…

    I’ll consider an option to exclude these older IE style rules since IE 6 and 7 are hardly used anymore.

    Hey Ravan … excellent job with your plugin. I use it for PDF docs and YouTube vids, myself.

    I think what the original poster was hinting at, however, was that he was probably using some type of speed optimization plugin that defers javascript or loads them in the footer, and when he implements that, everything works other than his Fancybox.

    Since Fancybox is dynamic, there is no javascript file to exclude from using in the footer.

    Great job in developing, maintaining, and supporting your plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Scripts to footer’ is closed to new replies.