Forum Moderators: travelin cat
The function is called from a link:
<a href="#" onclick="slideActiveLayer('down',20,100,0.5); return false;">up image</a>
and these functions do the slide: (I haven't coded js for a while so I'm rusty)
function slideActiveLayer(direction,steps,intervals,powr){
if(slideflag) return;
slideflag = true;
var width = parseInt(activeLayer.style.width)-273;
var currentleft = parseInt(activeLayer.style.left);
var endPos = currentleft;
if(direction=='up'){
if((width+currentleft)>272)endPos-=273;
if((width+currentleft)<273)endPos=endPos-(width+currentleft);
if((width+currentleft)<1){slideflag = false;return;}
}else{
if(currentleft<(0-272))endPos+=273;
if(currentleft>(0-273))endPos=0;
if(currentleft==0){slideflag = false;return;}
}
doLayerSlide(currentleft,endPos,steps,intervals,powr);
}
function doLayerSlide(startPos,endPos,steps,intervals,powr) {
if (activeLayer.timer)window.clearInterval(activeLayer.timer);
var counter = 0;
activeLayer.timer = window.setInterval(
function() {
activeLayer.style.left = easeInOut(startPos,endPos,steps,counter,powr)+'px';
counter++;
if (counter > steps) {
window.clearInterval(activeLayer.timer);
slideflag = false;
}
}
,intervals)
}
slideflag is just a boolean variable to stop the animation being called again until it has finished running and easeInOut is'nt really relevant.
Any help would be really appreciated, I'm going to start pulling hair out soon. Cheers
[edited by: jatar_k at 2:56 am (utc) on Oct. 3, 2006]
[edit reason] no urls thanks [/edit]
If you are "stuck" because the client uses it, you may want to encourage them to transition to a different browser. If the manufacturer doesn't even support it, it makes a difficult case for developers to support it.