質問

I am adding a wrapper to a division and trying to set offset right as follow:

                var wrapper_div = document.getElementById('container1');
                var kinetic_div = wrapper_div.children[0];
                canvaso = kinetic_div.children[0];
                canvaso.setAttribute('id', "panel1");
                canvaso.setAttribute('offset', '100px');

Unfortunately it does not work! Would appreciate your suggestions.

役に立ちましたか?

解決

Do this:

canvaso.style.offset = '100px;' 

or

canvaso.setAttribute('style','offset:100px;');

I presume that you are trying to change the style.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top