Skip to content
Permalink
Browse files

Finally get fancyBox working in Firefox!

Fixed the error at e7e6743.
  • Loading branch information...
VincentTam committed Dec 22, 2014
1 parent ebbc513 commit 1d40cea76d0006ed571996ddd67506f7daee43be
Showing with 28 additions and 30 deletions.
  1. +28 −30 source/_includes/custom/after_footer.html
@@ -15,39 +15,10 @@
var modernizr = document.createElement("script");
modernizr.src = "{{ root_url }}/javascripts/modernizr-2.0.js";
document.body.appendChild(modernizr);
var jqri = document.createElement("script");
jqri.src = "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";
document.body.appendChild(jqri);
var octjs = document.createElement("script");
octjs.src = "{{ root_url }}/javascripts/octopress.js";
octjs.type = "text/javascript";
document.body.appendChild(octjs);
// FancyBox
jqri.onload = function () {
var fbjs = document.createElement("script");
fbjs.src = "/fancybox/source/jquery.fancybox.pack.js?v=2.1.5";
fbjs.type = "text/javascript";
document.body.appendChild(fbjs);
var fbbtnjs = document.createElement("script");
fbbtnjs.src = "/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5";
fbbtnjs.type = "text/javascript";
document.body.appendChild(fbbtnjs);
var fbmedjs = document.createElement("script");
fbmedjs.src = "/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6";
fbmedjs.type = "text/javascript";
document.body.appendChild(fbmedjs);
var fbthmjs = document.createElement("script");
fbthmjs.src = "/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7";
fbthmjs.type = "text/javascript";
document.body.appendChild(fbthmjs);
// FancyBox local config
var fblocjs = document.createElement("script");
fblocjs.src = "/javascripts/FancyBoxLocal.js";
fblocjs.type = "text/javascript";
document.body.appendChild(fblocjs);
}
}
if (window.addEventListener) {
@@ -58,6 +29,33 @@
window.onload = downloadJSAtOnload;
}
(function() {
function getScript(url,success){
var script=document.createElement('script');
script.src=url;
var head=document.getElementsByTagName('head')[0],
done=false;
script.onload=script.onreadystatechange = function(){
if ( !done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') ) {
done=true;
success();
script.onload = script.onreadystatechange = null;
head.removeChild(script);
}
};
head.appendChild(script);
}
getScript("//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js",function(){
getScript("/fancybox/source/jquery.fancybox.pack.js?v=2.1.5", function() {});
getScript("/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5", function() {});
getScript("/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6", function() {});
getScript("/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7", function() {});
getScript("/javascripts/FancyBoxLocal.js", function() {});
});
})();
var cb = function() {
var h = document.getElementsByTagName('head')[0];
@@ -96,6 +94,7 @@
tcss.type = "text/css";
h.parentNode.insertBefore(tcss, h);
// CSS files for FancyBox
var fbcss = document.createElement("link");
fbcss.href = "/fancybox/source/jquery.fancybox.css?v=2.1.5";
fbcss.rel = "stylesheet";
@@ -114,7 +113,6 @@
fbthmcss.type = "text/css";
fbthmcss.media = "screen";
document.body.appendChild(fbthmcss);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||

0 comments on commit 1d40cea

Please sign in to comment.
You can’t perform that action at this time.