Last active
December 17, 2015 03:59
-
-
Save fabriceleal/5547487 to your computer and use it in GitHub Desktop.
Bookmarklet to import fartscroll.js (imports jquery 1.9.1 if cant find jQuery).
This file contains hidden or 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
(function(){ | |
var a = function(){ | |
var y = document.createElement('script'); | |
y.onload = function(){ jQuery(document).fartscroll(600) }; | |
y.src="https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js"; | |
document.head.appendChild(y); | |
}; | |
if(typeof jQuery == 'undefined') { | |
var x = document.createElement('script'); | |
x.onload = a; | |
x.src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"; | |
document.head.appendChild(x); | |
} else { | |
a(); | |
} | |
})(); | |
/* | |
Minified: | |
(function(){var e=function(){var e=document.createElement("script");e.onload=function(){jQuery(document).fartscroll(600)};e.src="https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js";document.head.appendChild(e)};if(typeof jQuery=="undefined"){var t=document.createElement("script");t.onload=e;t.src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";document.head.appendChild(t)}else{e()}})() | |
*/ |
Weird behavior using $. Switch to jQuery
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed to import jQuery when needed