test jquery offsetparent on SVG

by bakhshi

HTML

<div id="container">
    <div id="inner">
        <svg id="free">
            
        </svg>
    </div>
</div>

CSS

#container{
    background-color:blue;
    width:200px;
    height:200px;
}

#inner{
    background-color:green;
    width:150px;
    height:150px;
    position:relative;
    overflow:hidden;
}

#free{
    position:absolute;
}

JavaScript

$(function(){
    var fail = $("#free").offsetParent().get(0).tagName.toLowerCase() === "html";
    alert(fail?"FAILED":"AWESOME!");
})