Description
The .offsetParent() method returns the closest ancestor (parent) element with a specified position (a position different than default).
Tip: An element can be positioned with jQuery, or with the CSS position property (relative, absolute, or fixed).
v1.2.6
This method has the form:
.offsetParent()
Return Value
This form returns a jQuery object.
Examples
Set the background color of the first positioned parent element of the p element:
$("button").click(function(){
$("p").offsetParent().css("background-color","red");
});