Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Foobox not working well with CloudFlare

$
0
0

Replies: 0

Hi,

Just a question from my side: I noticed that the lightbox was no longer working while CloudFlare was active on a site, especially if the Rocket Loader is activated. The code changes from this:

<script type="text/rocketscript">/* Run FooBox FREE (v1.2.24) */
(function( FOOBOX, $, undefined ) {
  FOOBOX.o = {wordpress: { enabled: true }, excludes:'.fbx-link,.nofoobox,.nolightbox,a[href*="pinterest.com/pin/create/button/"]', affiliate : { enabled: false }, error: "Impossible de charger l’élément"};
  FOOBOX.init = function() {
    $(".fbx-link").removeClass("fbx-link");
    $(".foogallery-container.foogallery-lightbox-foobox, .foogallery-container.foogallery-lightbox-foobox-free, .gallery, .wp-caption, a:has(img[class*=wp-image-]), .foobox").foobox(FOOBOX.o);
  };
}( window.FOOBOX = window.FOOBOX || {}, FooBox.$ ));

FooBox.ready(function() {

  jQuery("body").append("<span style=\"font-family:'foobox'; color:transparent; position:absolute; top:-1000em;\">f</span>");
  FOOBOX.init();

});
</script>

to this:

<script type="text/foobox">/* Run FooBox FREE (v1.2.24) */
(function( FOOBOX, $, undefined ) {
  FOOBOX.o = {wordpress: { enabled: true }, excludes:'.fbx-link,.nofoobox,.nolightbox,a[href*="pinterest.com/pin/create/button/"]', affiliate : { enabled: false }, error: "Impossible de charger l’élément"};
  FOOBOX.init = function() {
    $(".fbx-link").removeClass("fbx-link");
    $(".foogallery-container.foogallery-lightbox-foobox, .foogallery-container.foogallery-lightbox-foobox-free, .gallery, .wp-caption, a:has(img[class*=wp-image-]), .foobox").foobox(FOOBOX.o);
  };
}( window.FOOBOX = window.FOOBOX || {}, FooBox.$ ));

FooBox.ready(function() {

  jQuery("body").append("<span style=\"font-family:'foobox'; color:transparent; position:absolute; top:-1000em;\">f</span>");
  FOOBOX.init();

});
</script>

It works when you tick to disbale the deferring of javascripts, but I was wondering if a fix regarding this issue was planned (I have a few websites, so that’s a lot of settings to edit.

Thanks for your answer


Viewing all articles
Browse latest Browse all 59525

Trending Articles