问题
Would it be possible to have on click div open a window but only if that window hasn't opened before? Not modal but just a regular window with a certain size say 300x300.
I have this Jsfiddle but not fully working yet. The idea is to have 1 popup window and just push it in the front if its already opened.
http://jsfiddle.net/BC9Rd/
回答1:
You can use something like this:
$("#element_id").click(function(){
window.open ("http://your-domain.com/your-url.html","my_window","menubar=1,resizable=1,width=350,height=250");
});
Basically every time you execute this window.open command, the same window will be utilized because of the same window name ("my_window" in this case)...
I hope this helps :)
来源:https://stackoverflow.com/questions/11250591/jquery-open-window-but-only-when-window-is-not-opened-already-then-show-it-in-f