Last active
August 29, 2015 14:02
-
-
Save lafikl/cf088bbf02798c66b0f5 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello world!</title> | |
</head> | |
<body> | |
<!-- some HTML things here --> | |
<div class="scrollable"></div> | |
<script type="text/javascript" src="Steady.js"></script> | |
<script> | |
var scrollable = document.getElementsByClassName('scrollable')[0] | |
var s = new Steady({ | |
conditions: { | |
"min-width": 400, | |
"max-bottom": 200 | |
}, | |
scrollElement: document.getElementsByClassName('scrollable')[0], | |
handler: fn | |
}); | |
function fn(values, done) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'imgs.html'); | |
xhr.onreadystatechange = function() { | |
if ( xhr.readyState == 4 ) { | |
scrollable.innerHTML += xhr.response; | |
// telling Steady that we're done processing! | |
done(); | |
} | |
}; | |
xhr.send(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment