Skip to content

Instantly share code, notes, and snippets.

@lafikl
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lafikl/cf088bbf02798c66b0f5 to your computer and use it in GitHub Desktop.
Save lafikl/cf088bbf02798c66b0f5 to your computer and use it in GitHub Desktop.
<!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