webForumDet fria alternativet

Slideproblem

0 svar · 181 visningar · startad av eriksson2002

eriksson2002Medlem sedan aug. 200216 inlägg
#1

Någon som vet hur man får detta script att flytta lagret åt vänster?

<script language="JavaScript">
<!--
// Copyrighted By Eddie Traversa
// http://dhtmlnirvana.com/
// All rights Reserved 2002

// Example -
// <a href="#" onmousedown="glide('elDiv',660,10)">glide</a>
// where the arguments are glide(id of layer, the end position of layer animation, number of steps)

function glide2(obj,endPos,steps) {
// changing this number will vary the amount of gliding
var decrease = 0.05;
if (document.getElementById) {
el = document.getElementById(obj).style ;
}
else if (document.all){
el = document.all[obj].style;
}
else if (document.layers) {
el = document.layers[obj];
}
// you can change references to left in the script to top and that will give a vertical animation
el.xpos = parseInt(el.right);
if (el.xpos < endPos) {
distance = endPos - el.xpos;
steps = distance*decrease;
// to shove a layer off screen change to
// el.xpos -= steps;
el.xpos += steps;
el.left = el.xpos;
// change the 30 value to increase or decrease speed, higher the numeric value the slower the speed
setTimeout("glide2('" + obj + "'," + endPos + "," + steps + ")",30);
}
}
//-->
</script>

128 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
124 ms — hämta tråd, inlägg och bilagor (db)