ok testar nått annat..
testar ett annat lite "enklare" script och hoppas någon kan hjälpa mig.
Mitt problem är alltså att scrollern anpassar sig efter oroginalinnehållet och inte ändras när man ändrar innehållet i den.
Samt att när man t.ex scrollat längst åt höger och byter innehåll i scrollen så visar den fortfarande längst till höger.
länk
<a href="#" onclick="document.all('divMenu').innerHTML='<img src=bilder/trans.gif width=5 height=3 boder=0><img src=bilder/umeny_startsida.gif width=58 height=16 border=0><img src=bilder/trans.gif width=15 height=3 boder=0><img src=bilder/umeny_kontaktaoss.gif width=80 height=16 border=0><img src=bilder/trans.gif width=15 height=3 boder=0><img src=bilder/umeny_vanligafragor.gif width=88 height=16 border=0>';" onfocus="this.blur()">
DIV
<a href="#" onmouseover="moveLeft(2)" onmousedown="clearTimeout(moveLeftVar); moveLeft(10)" onmouseout="clearTimeout(moveLeftVar)"><img src="bilder/meny_arrowleft.gif" border="0"></a>
<div id="container" style="position:relative; width:750px; height:18px; border:0px solid black; overflow:hidden">
<div id="divmenu" style="position:absolute; left:0; top:1;">
<nobr>
Originalinnehåll.
</nobr>
</div>
</div>
<a href="#" onmouseover="moveRight(2)" onmousedown="clearTimeout(moveRightVar); moveRight(10)" onmouseout="clearTimeout(moveRightVar)"><img src="bilder/meny_arrowright.gif" border="0"></a>
Script (ska ligga längst ner i body)
<script type="text/javascript">
var obj = document.getElementById ? document.getElementById("divmenu") : document.all.content;
var containerObj = document.getElementById ? document.getElementById("container") : document.all.content;
var contentWidth = obj.offsetWidth;
window.onload=function(){
contentWidth=obj.offsetWidth;
}
function moveRight(speed){
if (parseInt(obj.style.left)>contentWidth*(-1)+parseInt(containerObj.style.width))
obj.style.left=parseInt(obj.style.left)-speed;
moveRightVar=setTimeout("moveRight("+speed+")",4);
}
function moveLeft(speed){
if (parseInt(obj.style.left)<=0)
obj.style.left=parseInt(obj.style.left)+speed;
moveLeftVar=setTimeout("moveLeft("+speed+")",4);
}
</script>
jag har hittat ett script som fungerar helt perfekt bortsett från det faktum att det är en vertikal och inte en horisontell scroller