Start a new topic

HtmlDrawable and onEnterFieldOfVision

HtmlDrawable and onEnterFieldOfVision


Hi,

 

Lets say I create a HtmlDrawable with html '<span id='myId'>foo</span>'.

 

I want to add a class 'foo-visible' to it when the target is detected. I wish to apply a nice transition effect when target is detected.

My first guess was to use the function in 'Trackable2DObject' called 'onEnterFieldOfVision'. Only issue is I can't get reference to the HtmlElement which has id as 'myId'.

I also tried to explore all the DOM elements using this:

var items = document.getElementsByTagName("*");
for (var i = items.length; i--;) {
console.log(i);
console.log(items);
}

 

But it seems no <span> element among the visited DOM elements.

Thanks for any help.

 

Hi.
I think that you need to get the HtmlDrawable.html propertie and the put the class on inline-style. like set it again.
Html inside HtmlDrawable is not in the DOM (i think :D)

Good luck
 

 
Login or Signup to post a comment