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
/* | |
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/ | |
You can copy paste this code in your console on smashingmagazine.com | |
in order to have cross-fade transition when change page. | |
*/ | |
var cache = {}; | |
function loadPage(url) { | |
if (cache[url]) { |
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
/* Control Flow 4 - Serial Execution of an Array of Callback Functions | |
* | |
* Based on: | |
* - http://book.mixu.net/node/ch7.html | |
* - https://github.com/mixu | |
* | |
* Revised based upon comments from 'lanzz' to use 'process.nextTick(next)' instead of 'next()' | |
* Revised based upon comments from 'Israel' to use "typeof(callback) != 'undefined'" | |
* | |
* The 'Array.prototype.slice.call(arguments)' usage is a JavaScript trick and explained here: |