wierd opera failure

  • Thread starter detailsaresketchy
  • Start date
D

detailsaresketchy

I have been fiddling with this code for days now.It works in FF and IE
on windows, but not opera.

function slideRight(newX, interval) {

// get referencet to 'latest-thumbs', the holder

latestThumbs = document.getElementById('latest-thumbs');

// this code seems to choke here on the second, sometimes third
iteration
// but opera gives no error message as to why

if( !latestThumbs ) { return; }
if( latestThumbs.style ) { latestThumbs = latestThumbs.style; }

// add the appropraite measure suffix
var noPx = document.childNodes ? 'px' : 0;

// get left value for 'latest-thumbs'
latestThumbsX = latestThumbs.left.length;
latestThumbsX = latestThumbs.left.substr(0,latestThumbsX-2);

distance = parseInt(latestThumbsX) + parseInt(newX);

if (!interval) {
newLeft = Math.ceil(distance / 2);
} else {
newLeft = parseInt(latestThumbsX) + interval;
}

newLeft = newLeft + noPx;
latestThumbs.left = newLeft;

if ( (parseInt(latestThumbs.left) - 1) > newX ) {
interval = ( parseInt(newX) - parseInt(latestThumbs.left) ) / 2 ;
foo = window.setTimeout("slideRight(" + newX + "," + interval + ")",
60);
alert("fire5");
} else {
lastLeft = (newX) + noPx;
latestThumbs.left = lastLeft;
scroll.inprogress=0;
}

}

There is working code of this at http://www.johnvink.com/demo/

The function is used to slide the image thumbnails to the left. I am
relatively new to javascript. Perhaps I am going about this task all
wrong? Any ideas are greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top