JSFiddle - React, Tailwind, and code Playground

by TJ VanToll

HTML

<p><a href="http://bugs.jqueryui.com/ticket/9057">jQuery UI #9057</a>: Getting the <code>scrollParent</code> fails in IE if the parent is not positioned.</p>

<link href="http://code.jquery.com/ui/jquery-ui-git.css" rel="stylesheet" />
<script src="http://code.jquery.com/ui/jquery-ui-git.js"></script>

<div id="outer">
    <div id="inner"></div>
</div>

CSS

body { padding: 20px; } p { margin-bottom: 20px; }

#outer {
    height: 100px;
    overflow: scroll;
}
#inner {
    height: 2000px;
    background-color: red;
}

JavaScript

console.log( $( "#inner" ).scrollParent().attr( "id" ) );