Last active
December 17, 2015 03:59
-
-
Save dschep/5547713 to your computer and use it in GitHub Desktop.
fartscroll.js
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
javascript:(function(){function b(b,e){var c=document.getElementsByTagName("head")[0],a=document.createElement("script");a.src=b;var d=!1;a.onload=a.onreadystatechange=function(){if(!d&&(!this.readyState||"loaded"==this.readyState||"complete"==this.readyState))d=!0,e(),a.onload=a.onreadystatechange=null,c.removeChild(a)};c.appendChild(a)}void 0===window.jQuery?b("https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js",function(){$("<script>").attr("type","text/javascript").text("$.noConflict();").appendTo("body"); | |
b("https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js",function(){jQuery(document).fartscroll()})}):b("https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js",function(){jQuery(document).fartscroll()})})(); |
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
(function() { | |
// from http://stackoverflow.com/questions/756382/bookmarklet-wait-until-javascript-is-loaded | |
function loadScript(url, callback) | |
{ | |
var head = document.getElementsByTagName("head")[0]; | |
var script = document.createElement("script"); | |
script.src = url; | |
// Attach handlers for all browsers | |
var done = false; | |
script.onload = script.onreadystatechange = function() | |
{ | |
if( !done && ( !this.readyState | |
|| this.readyState == "loaded" | |
|| this.readyState == "complete") ) | |
{ | |
done = true; | |
// Continue your code | |
callback(); | |
// Handle memory leak in IE | |
script.onload = script.onreadystatechange = null; | |
head.removeChild( script ); | |
} | |
}; | |
head.appendChild(script); | |
} | |
if (window.jQuery === undefined) { | |
loadScript('https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', function() { | |
$('<script>').attr('type', 'text/javascript').text('$.noConflict();').appendTo('body'); | |
loadScript('https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js', function() { | |
jQuery(document).fartscroll(); | |
}); | |
}); | |
} else { | |
loadScript('https://raw.github.com/theonion/fartscroll.js/master/fartscroll.js', function() { | |
jQuery(document).fartscroll(); | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy Install: http://dschep.github.io/GistMarklets#5547713