position() in Wordpress

position() in Wordpress

I'm trying to implement this simple code in WordPress:

jQuery(document).ready(function ($) {
...

$("#menu-secondmenu").position({
"my": "top left",
"at": "left bottom",
"of": $("#menu-custom-menu-scomparsa")
});
...
})


The rest of the function works fine, and I don't see any error message in the console, thus I believe JQuery UI is correctly recognized, but nothing happens to the two elements in question, or to any other couple of elements I'm trying to apply the position() to. How can I debug the reason? Thank you.