Not really. The DOM is arranged like a tree, and positioning is based on, like you said, original position and the position of a node's parent - not it's siblings. If you've got 2 buttons beside each other and you want the second to be, say, 20 pixels left of the first, set the "margin-left" property.
Also, this is client-side, not PHP code, so I'll move the topic.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.