Search code examples
html5-canvaskineticjs

How to get an HTML element into KineticJS


I want to apply Kinetic.Tween() for an HTML element like an . Is there any way to get the element in kineticJS.

I have tried to getById() and getByName() but didnt work.

I have an image with overlay text like this..

<div id="helplayer">
    <img src='images/help.png' alt="help"/>
    <div class="overlay">
         <h1><i>Instructions</i></h1>
              Some Instructions
     </div>
</div>

Now i want to apply Kinetic.Tween() for display that image like a popup with BounceEaseInOut.

Can anyone help me.. Thanks in Advance.


Solution

  • You can't use kinetic's Tween for work with dom elements. Because the Tween only for KineticJS canvas objects. You may use other libs, for example: https://github.com/sole/tween.js/