Created
February 7, 2016 17:03
-
-
Save luruke/5bf738285ad957955288 to your computer and use it in GitHub Desktop.
Add barba on wikipedia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Barba wikipedia.org | |
var js = document.createElement('script'); | |
js.type = 'text/javascript'; | |
js.onload = initBarba; | |
js.src = 'https://luruke.github.io/barba.js/dist/barba.min.js'; | |
document.body.appendChild(js); | |
function initBarba() { | |
Barba.Pjax.Dom.parseContainer = function(el) { | |
return el.querySelector('#content'); | |
}; | |
Barba.Pjax.Dom.putContainer = function(el) { | |
var footer = document.getElementById('footer'); | |
footer.parentNode.insertBefore(el, footer); | |
}; | |
Barba.Pjax.init(); | |
Barba.Prefetch.init(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment