Forum Moderators: travelin cat

Message Too Old, No Replies

sliding a div layer using js not working in IE 5.2

IE5.2 hates me

         

topcatwonder

9:25 pm on Oct 2, 2006 (gmt 0)

10+ Year Member



Can anyone help, I've created a layer to act as a mask and another layer within it that slides left or right to show different images. The layer animates as intended in IE6 and firefox but not IE5.2 for mac (or navigator 7.0 but I've given up on NN). I don't own a mac and it's killing me

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]

whoisgregg

7:20 pm on Oct 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know this isn't an answer to your question, but Internet Explorer for the Mac is a dead product. Microsoft officially ended supporting it December 31st, 2005 [webmasterworld.com].

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.