Commit 5e08de08 authored by Daniel STAN's avatar Daniel STAN
Browse files

[wifimap] smooth scroll

parent b33108db
......@@ -364,7 +364,23 @@ WifiMap = {
}
this.highlighted = this.listeBornes[hostname];
this.highlighted.highlight(true);
window.location.hash = hostname;
this.slideTo(this.highlighted.html_list);
},
'slideTo': function(elem) {
//Animation de slideover
var scroll = elem.parentNode;
var from = scroll.scrollTop;
var to = elem.offsetTop - scroll.offsetTop;
var i = 0, count = 10;
function iter() {
i++;
scroll.scrollTop = (i*to + (count - i)*from)/count;
if( i < count) setTimeout(iter,20);
}
setTimeout(iter,20);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment