yet another doubt on unsetProperty

Hi ....

Consider this :

CASE 1 )

In markup I have :

<div id = "diva" > </div>

In Script :

document.diva.setProperty("x","100px");
document.diva.unsetProperty("x");

Assume no animation on "diva"
::::::::::::::::::::::::::::
This will cause the div to have style:x = 100px since style:x is not explicitly specified (in xmu ) by the content author and hence even after unsetting the style:x its value persists .

CASE 2)

In markup I have :

<div id = "diva" style:x="20px" > </div>

In Script :

document.diva.setProperty("x","100px");
document.diva.unsetProperty("x");

Assume no animation on "diva"
::::::::::::::::::::::::::::
This will cause the div to have style:x = 20px since style:x is explicitly specified (in xmu ) by the content author,thus here unsetting from script causes the at-rest value to re-load.

Is this understanding correct

Thanks in advance.






Answer this question

yet another doubt on unsetProperty

  • Mark Macumber

    In the first case, the default value is 0px so it will be kept.

    In the second case, you are correct.



  • Minherz

    Thanks for the clarification

    Actually saw this in Toshiba Entertainment Tiltle content ( chapter.js )(The Old boy)

    document.num01s.style.backgroundFrame = groupNumber - 1;
    document.tit01s.style.backgroundFrame = groupNumber - 1;
    document.num01s.style.unsetProperty("backgroundFrame");
    document.tit01s.style.unsetProperty("backgroundFrame");

    It ran as intended by content author in Toshiba Player ( i.e. the value of backrounframe persisted ) but not on iHd Sim ....

    In markup no backgroundframe for the element is specified
    Also the backgrounframe is not animated in markup

    and according to ur clarification the ihDSim behaviour is correct
    since the statements are cancelling out each other.

    looks like incorrect content.

    The movie was good though..

    thanks



  • Kamii47

    Please don't use Old Boy as a model for HDi programming. It was an early title and does things it should not.

  • yet another doubt on unsetProperty