Adjust popup menu when used in responsive design.

I have one messagebar where i am showing all the app message, which is kind of responsive. As soon as message goes i am adjusting the height and width of window. Now for some div i am showing the popup menu , now the issue is as soon as message got disappear and i am adjusting the height , the popup still remain on the same position. Do we have solution for this other than manually getting the height and width of message bar and then adjusting the popup position again. or any css trick. Please reply

You can try to call show() method passing the required parameters to update popup position.