Using jQuery UI Sortable inside an iframe - handling bugged

Using jQuery UI Sortable inside an iframe - handling bugged

I have a somewhat old webpage using iframes as parts of a page. All iframes contain the same header html and the jQuery loaded in all of them is the same.
I'm trying to make a dynamically generated object inside one of the iframes sortable. Everything works like it should except the handling - when I click on a draggable object, it usually only responds to mouse movement when the cursor is in one of the three other iframes (random one, I'm guessing the one that first loads the jQuery UI). Very rarely does it work as it should.
How to fix this?