Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FRP Infinite Scroll with Bacon.js -- Starting File
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>FRP Infinite Scroll using Bacon.js</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.53/Bacon.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.7.0/lodash.min.js"></script>
<style type="text/css">
body {
margin: 0;
padding: 0;
font-family: Helvetica, arial, freesans, clean, sans-serif;
}
.phonebook {
position: relative;
/* draw fake row bg colors with css */
background-image: linear-gradient(#f3f3f3 50%, transparent 50%, transparent);
background-size: 60px 60px; /* twice the height of a row, since the pattern spans two rows */
margin: 0;
padding: 0;
list-style: none;
}
.phonebook li {
position: absolute;
height: 30px;
line-height: 30px;
padding: 0 10px;
color: #999;
font-size: 12px;
}
</style>
</head>
<body>
<ul id="Phonebook" class="phonebook"></ul>
<script>
(function(){
var totalResults = 10000;
var rowHeight = 30;
var phonebookEl = document.getElementById('Phonebook');
phonebookEl.style.height = totalResults * rowHeight + "px";
// ...
})();
</script>
</body>
</html>
@SimplGy

This comment has been minimized.

Copy link
Owner Author

commented May 1, 2015

Intro code for the article: http://www.simple.gy/blog/infinite-bacon/

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.