13 lines
328 B
JavaScript
13 lines
328 B
JavaScript
|
|
|
||
|
|
var h = d3.select('section#trs').node().getBoundingClientRect().top;
|
||
|
|
|
||
|
|
d3.select(window).on("scroll",function(){
|
||
|
|
var t = d3.select('#trs').node().getBoundingClientRect().top;
|
||
|
|
var trans= Math.min(Math.round(100*(h-t)/h)/100,0.98);
|
||
|
|
d3.selectAll('.trans').style("background-color","rgba(51,51,51,"+ trans +")");
|
||
|
|
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|