title: How to loop through all parent elements using jQuery
body: <p>So I have an image that I need to call .width and .height but I'm running into the old problem with IE returning 0 if any of the parent elements are not visible.</p>
  
  <p>Because of the dynamic nature of this particular task, it's not possible to tell at design time which elements will be visible. So my solution to this is to take my image element and then go up the element hierarchy one parent at a time and set it to visible if it isn't. I'm going to add the element id to an array if I set it to visible so I know which ones to flip back to hidden after I get the width/height.</p>
  
  <p>So my question is: how do I write a recursive jQuery function go up the element tree and check if the element is hidden or not?</p>