HotthoguePert
New Member
I am trying out the following code:\[code\]<!DOCTYPE html><html><head><script src="http://stackoverflow.com//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><script>$(document).ready(function(){ $("span").click(function(){ alert($(this).offsetParent().length); });});</script></head><body><p>If you click on me, I will disappear.</p><p><span>Click me away!</span></p><p>Click me too!</p></body></html>\[/code\]From the jQuery documentation, \[code\]offsetParent()\[/code\] is supposed to return the closest positioned parent, positioned meaning one with \[code\]position\[/code\] defined explicitly as 'static\[code\],\[/code\]absolute\[code\]or\[/code\]relative`. here, none is declared for any element, yet the laert pops up 1. How come?