LADYX,
для меньше 1000px
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style>
.wrp {
display: block;
position: relative;
overflow: hidden;
visibility: visible;
overflow-x: scroll;
width: 100%;
height: 200px;
background: #cccccc;
}
.blk {
display: block;
position: relative;
width: 1000px;
height: 500px;
z-index: 2;
margin-left: 100%;
background: #aabbcc;
}
.knop {
display: block;
position: absolute;
width: 20px;
height: 20px;
right: 10px;
top: 50%;
background: red;
cursor: pointer;
}
</style>
</head>
<body>
<div class="wrp">
<div class="knop"></div>
<div class="blk"></div>
</div>
<script>
function timer(b) {
return {
play: function() {
var d = performance.now();
c = !0;
b.from = b.from ||b.elem.scrollLeft;
requestAnimationFrame(function e(a) {
a = (a - d) / b.duration;
1 <= a && (a = 1, b.callback && b.callback());
b.elem.scrollLeft = b.from + (b.to - b.from) * a | 0;
1 > a && requestAnimationFrame(e)
})
}
}
};
var wrp = document.querySelector('.wrp'),
but = document.querySelector('.knop'),
anim = timer({
from : 0,
to : document.documentElement.clientWidth,
duration: 2 * 1000,
elem : wrp,
callback : function() { }
});
but.addEventListener('click', anim.play);
</script>
</body>
</html>