<style type="text/css">
div {
border: 1px dotted #DDD;
position: absolute;
overflow: hidden;
width: 200px;
height: 50px;
}
span {
background: blue;
position: absolute;
color: white;
text-align: center;
width: 50px;
height: 50px;
}
</style>
<script type="text/javascript">
window.onload = function(){
var element = document.getElementsByTagName('span')[0], i = 0;
(function(){
element.style.left = (++i<200) ? i+'px' : i = 0;
setTimeout(arguments.callee, 10);
})();
};
</script>
<div>
<span>Text</span>
</div>