Problem with animation

I tried to move div element with a button from one point in another.

I use following code:

document.getElementById('playButtonDiv').style.animateProperty("x", "0px;350px", 3);

<div id="playButtonDiv" style:position="absolute" style:x="0px" style:y="0px" style:width="60px" style:height="60px">
<button id="playButton" style:width="60px" style:height="60px" style:backgroundImage="url( 'Images/PlayButton.png' )" style:contentWidth="scale-to-fit" style:contentHeight="scale-to-fit"></button>
</div>

I see that animation isn't smooth. How can I do smooth animation

P.S.

w2k3 SP1, Intel Pentium 4 CPU 2.00GHz, 1024MB RAM, NVIDIA GeForce FX 5200 128Mb, DirectX 9.0c

My TitleSet:

<TitleSet timeBase="60fps" >




Answer this question

Problem with animation

  • PSHK

    If you set your tickBase to 24fps in the titleset then it might be smoother.

    Also, instead of:

    document.getElementById('playButtonDiv')

    you can just write:

    document.playButtonDiv

    since all elements with an id are added to the document as named properties.

    You should also consider putting a style:position="absolute" on your button, if you ever intend for it be anywhere other than (0, 0)



  • waheyluggage

    > How can I do smooth animation

    You cannot ;)

    According to the iHD spec. an iHD frame that is not ready yet shall be skipped (means the old frame is shown until the new one is ready). So it dependes on the rendering/presentation engine of the iHD Runtime and your hardware if an animation is smooth or not.

    I cannot give you any information about the Mircosoft iHD player and if they use hardware acceleration or not (maybe you can speed it up by chaning some setting ect.)



  • Problem with animation