I would like to create a popup menu with javascript in sharepoint, for example, when you click on the first item in the document library:

I think it should be possible to use SP.UI.PopoutMenu , but the MSDN documentation is poorer on this element and cannot find any tutorial on how to use it.
If I just try to open it, nothing will happen:
var anchorId = 'myAnchorId', menuId = 'myMenuDivId', iconId = '', anchorOpenCss = '', textDirection = 'ltr', closeIconUrl = '', isClustered = false, x = 500, y = 500, height = 500, width = 500; SP.UI.PopoutMenu.createPopoutMenuInstanceAndLaunch(anchorId, menuId, iconId, anchorOpenCss, textDirection, closeIconUrl, isClustered, x, y, height, width);
Any ideas?
PS: I do not want to expand the document library menu, I want to create my own pop-up menu!
source share