Both style.top and translateY() seem to round to full pixel values. Is there any way to get an image to rest on a subpixel?
As an example, here I am moving a div with an image in it down 0.1 pixels every 100ms, and as you can see, it just jumps a full pixel every second. https://jsfiddle.net/je391bfr/
var i= setInterval(function() {this.myTimer(); },100);
var y=0;
var div=document.getElementById('mytest');
function myTimer(){
this.y+=.1;
console.log(this.y);
//var tr="translateY("+this.y+"px)";
var tr="translate(0,"+this.y+"px)";
this.div.style.webkitTransform=tr;
this.div.style.mozTransform=tr;
this.div.style.msTransform=tr;
this.div.style.oTransform=tr;
this.div.style.transform=tr;
}
Note: I want something that can STOP on a subpixel if I want, not just be on a subpixel during animation.