NeXTs / Clusterize.js

Tiny vanilla JS plugin to display large data sets easily
https://clusterize.js.org
MIT License
7.22k stars 412 forks source link

Proposition #7

Closed ghost closed 9 years ago

ghost commented 9 years ago

Wouldn't it be better to use something like this?

<script>
function updateContent(source, target){
    target.innerHTML = source.scrollTop;
}
</script>
<style>
* {
    margin: 0px;
    padding: 0px;
    border: 0px;
}

.content {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 300px; 
    height: 400px; 
    background-color: lightgrey;
}

.scrollbar {
    position: relative;
    left: 0px;
    top: 0px;
    width: 316px; 
    height: 400px; 
    background-color: lightgreen;
    overflow-y: scroll;
}
</style>

<div class="scrollbar" onscroll="updateContent(this, this.nextSibling);"><div style="height: 5000px;"></div></div><div class="content">y</div>
NeXTs commented 9 years ago

How this should work with rows which height are smaller than .content height?

ghost commented 9 years ago

You put them into the .content div I assume.

NeXTs commented 9 years ago

Thank you for the suggestion László, but I will not change plugin's implementation. Probably it's idea for another plugin.

ghost commented 9 years ago

Ok. Have a nice day! :-)

NeXTs commented 9 years ago

You too :+1: :)