Jquery offset() does strange things, when called on fixed positioned element.
First call of myFixedElement.offset(position) positions element relative to window, all next calls will position it relative to document.
You can try demo. Just scroll to the bottom and click on “Hell yes”. Notice the “Hell no” disappearing. Click again. “Hell no” will show again.
What is wrong with my code?
This fixes it: http://jsfiddle.net/w9WqJ/3/
Somehow offset does not work if there are no initial values.