Sorry to have to ask yet another position:fixed related question, but reading through various other questions and forum threads hasn\'t helped me with this one.
I had the same requirement, to position an element fixed at it's natural (default) static position with relation to the viewport. I ended up using this simple jQuery function.
function SetFixedPositioning(element) {
var currentOffset = $(element).offset();
$(element).css("position", "fixed");
$(element).offset(currentOffset);
}
Use it like this:
SetFixedPosition($("#element-to-position"));
My use case was a second level navigation menu that flowed into the document, then was fixed at that position.