Question: I'm trying to vertically center an absolutely positioned caption over an image that has a flexible height (max-width: 100%;) and having trouble. I know I need to use JS to detect the height of the div and adjust the top positioning of the caption div, but I'm having trouble.

<http://jsfiddle.net/A69Xr/>

```
    <div id="nav">navigation</div>
<div id="slider">
    <img src="http://codeword.org/wp-content/uploads/2011/07/aspen_colorado.jpg">
    <div class="caption">
        <div class="wrap">
            <h1>Title</h1>
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        </div>
    </div>
</div>

```

Answer: 
You can try following way. Inside the for loop get the data node as JSONObject. From that data node you can extract every property. I just extracted mother name from data.

```
JSONObject data = (JSONObject) jsonObject.get("data");
final String motherName = (String) data.get("MOTHERS_NAME");

```
What library are you using to parse JSON ? I'd recommend that you use [Jackson](https://github.com/FasterXML/jackson-core) 

For eg: To get the data you read from the file in a Map, you can write a method like this.

```
   @SuppressWarnings("rawtypes")
 public static Map toMap(Object object) throws JsonProcessingException{                   ObjectMapper mapper = new ObjectMapper();
    return mapper.convertValue(object, Map.class);
}

```