Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在单击 div 时打开一个窗口,但前提是该窗口之前没有打开过?不是模态的,而只是具有一定大小的常规窗口,例如 300x300。
我有这个 Jsfiddle 但还没有完全工作。这个想法是有 1 个弹出窗口,如果它已经打开,只需将其推到前面。
http://jsfiddle.net/BC9Rd/
你可以使用这样的东西:
$("#element_id").click(function(){ window.open ("http://your-domain.com/your-url.html","my_window","menubar=1,resizable=1,width=350,height=250"); });
基本上每次执行此 window.open 命令时,都会使用相同的窗口,因为窗口名称相同(在本例中为“my_window”)...
我希望这有帮助 :)