It's because you're displaying the menu below the positioned elements (on the z axis). It works for the static positioned element because z-index doesn't apply in that situation. You have two options: Add the
ui-front class to the ancestor that is positioned or use the appendTo option to specify where the menu should be placed in the DOM. I've applied both changes in
https://jsfiddle.net/nap04mLa/4/ so you can see how they work (the
ui-front class would more likely go into the HTML, but I wanted the change to be easily discovered). See
http://api.jqueryui.com/theming/stacking-elements/ for more details.