Match and track the position of two elements

Also using this method - Math Equation

position tracking test - MHv1.hype.zip (15.7 KB)

You can even pass arguments to the aliased hype function from thecustom Math Equation so you can run more that one set of elements from the same aliased hype function.

position tracking test - MHv2.hype.zip (18.8 KB)


Another example.

Math Equation

The EllipsePurp & EllipseTeal elements. follows left property

function (t, start, dur) {
   try{
 window.hypFunc('EllipsePurp','EllipseTeal','left')
  }catch(err){
console.log(err)
}
   return t / dur;
}

The EllipsePink & EllipseBlue elements. follows top property

function (t, start, dur) {
   try{
 window.hypFunc('EllipsePink','EllipseBlue','top')
  }catch(err){
console.log(err)
}
   return t / dur;
}

hype function.

 window.hypFunc = function(targetTofollow,follower,prop){
 
 	 
 	 
   var EllipsePin_  = hypeDocument.getElementById(targetTofollow)
  	 
  	 var Prop_ = hypeDocument.getElementProperty(EllipsePin_, prop) 
  
  	   var EllipseBlue_ = hypeDocument.getElementById(follower)  
    hypeDocument.setElementProperty(EllipseBlue_, prop, Prop_, 0, 0)
  }

position tracking test - MHv3.hype.zip (18.2 KB)

2 Likes