Results 1 to 2 of 2

Thread: maximum position restraint

  1. #1
    Join Date
    Apr 2009
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default maximum position restraint

    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.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,799
    Thanks
    2
    Thanked 420 Times in 414 Posts

    Default

    Code:
    zxcBAnimator('left',obj,srt,Math.max(fin,0),200);

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •