Skip to content

Instantly share code, notes, and snippets.

@lafikl lafikl/scrollable.html
Last active Aug 29, 2015

Embed
What would you like to do?
<!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
You can’t perform that action at this time.