JQuery fade popupwindow

I am using the popupwindow plugin for jquery to show the form in popupwindow. How to close the window after sending? This is the link I'm talking about. I can open the link in the puppet window. But after sending, I want it to open in the parent window.

+3
source share
3 answers

You can attach the behavior to your link on a popup page:

<a href="javascript: self.opener.location = 'http://somewhere.ltd/path/to/dir'; self.close();">
     Let go Somewhere
</a>

In addition, I recommend that you use Javascript in an unobtrusive way instead of the simple line above.

About this operation "Fade"; You cannot do this in the OS window using Javascript (no matter what).

: id theChildForm jQuery:

$("#theChildForm").submit(function() {
     // TODO: Some data keeping jobs to be done
     // Pass the url if needed
     self.opener.location = 'http://somewhere.ltd/path/to/dir';
     self.close();
     // ...
    });
+5
0

, :

window.opener

The openener property corresponds to the window that opens the window. When accessing the child window, it returns the parent window.

0
source

Source: https://habr.com/ru/post/1705925/


All Articles