How to use position fixed in an iframe on JIRA

We are a plugin on JIRA and we are trying to add a floating widget in our iframe. We used position: fixed, but when scrolling, the widget doesn’t float/is not fixed to the position because the element is inside our iframe. I tried to do the calculation of the position using AP.scrollPosition.getPosition but it is returning null. Is there a work around this issue?

If the widget t is staying fixed to the iframe’s document left/top position and the issue is that you want it to move downwards as the user scrolls on the page, I doubt that there’s anything you can do. I don’t know of any scrolling api’s provided by ACJS (but I might be wrong - there can be hidden things in there :slight_smile: ). The reason that I don’t think that there’s anything you can do is that you would have to render outside of the iframe since if you scroll the iframe off the page - your widget would need to go with it :).

That said - Have you looked at https://developer.atlassian.com/static/connect/docs/latest/javascript/module-messages.html ?

1 Like

Yeah, I found a related problem when using the new DropdownList module in ACJS API v5. You can render the dropdown list adjacent to its triggering link in the iFrame, but if the user scrolls the page in which the iFrame is embedded, the dropdown list becomes disconnected from its trigger link. I’m therefore watching this thread with interest.

1 Like