<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
div{
position: fixed;
display: inline-block;
}
body, html{
min-width: 2000px;
position: relative;
}
</style>
</head>
<body>
<div>?</div>
<script>
window.onscroll = function ()
{
var div = document.querySelector('div'),
scrollWidth = document.documentElement.scrollWidth,
clientWidth = document.documentElement.clientWidth,
maxScroll = Math.max(scrollWidth, clientWidth) - document.documentElement.clientWidth,
scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
div.innerHTML =(scrollLeft == 0 || scrollLeft == maxScroll) ? scrollLeft ? 'max' : 'min' : scrollLeft;
}
</script>
</body>
</html>