Question

When I go to create my status bar overlay, I note that I can include a position attribute. I want to be able to dynamically change this attribute. Near as I can tell, just using JavaScript to find the element and change the position attribute doesn't move the status bar panel around on the status bar.

Any suggestions as to how to accomplish this?

Thanks, Nathan

Was it helpful?

Solution

You're right, changing the position doesn't seem to have any effect; I assume the XUL engine is only looking at it when it inserts the node into the main document's DOM tree.

Looks like DOM element manipulation stuff will work.

var nodeToMove = ...;
var parent = nodeToMove.parentNode;
parentNode.removeChild(nodeToMove);
parentNode.insertBefore(nodeToMove, someOtherNode);

would take the node from anywhere and stick it before someOtherNode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top