PDA

View Full Version : maximum position restraint



jpweeks
04-16-2009, 04:50 PM
function mLeft(){
var obj=document.getElementById('places');
var srt=obj.offsetLeft;
var fin=srt+585;
zxcBAnimator('left',obj,srt,fin,200);
}


I have this script that modifies the position of the div element 'places'. I want to limit the maximum left position at zero so that the function will not execute if 'fin' will become greater than zero as a result of the function.

vwphillips
04-17-2009, 08:04 AM
zxcBAnimator('left',obj,srt,Math.max(fin,0),200);