Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

$("#heading").offset({ left: left Offset });


var engine = function () {
   if ( (offsetTop === 0 && offsetLeft <= 200) || (offsetTop < 200 && offsetLeft === 200) ){
        moveHeading(); 
    } 
   else if ( (offsetTopReverse === 200 && offsetLeftReverse <= 200) || (offsetTopReverse <= 200 && offsetLeftReverse === 0) &&
            ( offsetTopReverse != 0 || offsetLeftReverse != 0 ) ){
       moveHeadingReverse();
       console.log("reverse");
       console.log(offsetTopReverse,offsetLeftReverse);
    } else if ( offsetTopReverse === 0 && offsetLeftReverse === 0) {
        offsetLeft = 0;
            offsetTop = 0;
            offsetLeftReverse = 200;
            offsetTopReverse = 200;
    }
}

Source by nullorempty.org #
 
PREVIOUS NEXT
Tagged: #left #Offset
ADD COMMENT
Topic
Name
9+5 =