0

I'm using iframe in my site. There are lots of question list each question has button add comment and on this button click modal opens. I want to set this modal always in center of screen irrespective of height of iframe. I have option in modal property like position top center bottom but is should be open near clicked add comment button instead of iframe of top.

Note: I have access of iframe we can use postmessage if it has solution

enter image description here

check above image modal opened on top of iframe instead of visible screen or near add comment button

how to adjust its position to near clicked add comment button?

enter image description here

it showing on top of iframe

Sagar Kodte
  • 3,723
  • 4
  • 23
  • 52
  • Does this answer your question? [Moving ModalPopup Outside the IFrame. Possible?](https://stackoverflow.com/questions/295621/moving-modalpopup-outside-the-iframe-possible) (specifically the modal cannot get outside of its iFrame, but one of the answers uses the parent page to get the popup content from the iFrame to display it. It can be adapter with postMessage) – Kaddath Aug 22 '23 at 07:20
  • I guess no @Kaddath – Sagar Kodte Aug 22 '23 at 07:22
  • I'm using reactjs on both platform – Sagar Kodte Aug 22 '23 at 07:23
  • Have you actually read the answers? Anyway you should add details to your question, example of code, and limit to one question only – Kaddath Aug 22 '23 at 07:24
  • yes none of them useable answer, I have iframe on different domain but I have access of it. we can communicate through postmessage – Sagar Kodte Aug 22 '23 at 07:26
  • I'm just trying to help, but I won't go through every possible solution in a tutorial. You have different solutions, you must choose one. Good luck – Kaddath Aug 22 '23 at 07:28
  • ok. Thank you for suggestion – Sagar Kodte Aug 22 '23 at 07:30

0 Answers0