caute,
Našiel som niečo takéto :
Kód:
transition: left 2s ease-out; left: 800px;
cele:
Kód:
<html>
<head>
<title>JavaScript Animation</title>
<script type="text/javascript">
<!--
var imgObj = null;
var animate ;
function init(){
imgObj = document.getElementById('myImage');
imgObj.style.position= 'absolute';
imgObj.style.left = '-180px';
}
window.onload =init;
//-->
</script>
</head>
<body>
<div style="width:500px; background-color:#999; height:200px; position:relative; overflow:hidden;">
<div id="myImage" style="width:2000px; background-color:#0FF; height:20px; position:absolute; overflow:hidden; transition: left 2s ease-out; left: 800px;">
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
<div style="width:50px; background-color:#C6F; height:20px; overflow:hidden; display:inline-block; float:left">AHO AHOJ</div>
<div style="width:50px; display:inline-block; background-color:#ffF; height:20px; overflow:hidden; float:left">AHO AHOJ</div>
</div>
</div>
</body>
</html>
teda je to riešene hlavne cez css, tak neviem je to možné použiť namiesto js ?? ( kamoš to použil na stranke čo robil )