而且......我给了你从html调用函数的代码,但我忘了 说我正在用Flash调用函数: on(release){ u =" popup.htm" ;; n =''nnn''; ww = 450; hh = 560; img =''cactus.jpg''; tt =''Titletitle' '; getURL(" javascript :openPop(" +"''" + u +"''" +'' '' + QUOT; '' & + n +和+,++和+ ww +,和+,+和+++ hh + ;''" +'',''+"''" + img +"''" +'',''+"''" + tt +"''" + ")"); } 我收到来自PHP / MySQL和我的那些变量(u,n,ww等)的值 使用它们打开弹出窗口。为什么弹出窗口?简单:它是一个视觉艺术家(画家)的网站,网站的内容是他的作品(我为页面添加了10 缩略图,我点击了他们打开弹出窗口)。使用单个弹出框的 的想法是避免一个用户同时在 打开10个弹出窗口...所以我不得不调解一个解决方案... 感谢cose,现在我必须了解如何在swf文件中使用它。 最好的问候, PM Hi,I have two buttons calling the same funtion to open a popup window,dinamically built according to parameters passed to the function.The problem: when I click the first button (or the second), anythinggoes. When I call the function again /that is, from the athor button), Iget no window subtitution: that is, the second popup loads into thefirst, loosing w and h too...I simply need this substitution: is this possible?Thanks to everybody in advance, PM---<script>function openPop(url, nome, w, h, pD, tD) {var features = "";features += "scrollbars=no,";features += "menubar=no,";features += "resizable=no,";features += "left="+Math.floor(screen.width/2-w/2)+",";features += "top="+Math.floor(screen.height/2-h/2)+",";features += "alwaysRaised=yes,";features += "width=" + w + ",";features += "height=" + h;nw = window.open(url, nome, features);nw.document.open();nw.document.write("<html>");nw.document.write("<head>");nw.document.write("<title>"+tD+"</title>");nw.document.write("</head>");nw.document.write("<body leftmargin=''0'' topmargin=''0'' marginwidth=''0''marginheight=''0''>");nw.document.write("<img src="+pD+" width="+w+" height="+h+" title="+tD+">");nw.document.write("</body>");nw.document.write("</html>");nw.document.close()}</script><ahref="javascript:openPop(''popup.htm'',''des'',''499'','' 610'',''desert.jpg'',''desert'')">b1</a><ahref="javascript:openPop(''popup.htm'',''tus'',''330'','' 630'',''cactus.jpg'',''cactus'')">b2</a> 解决方案href="javascript:openPop(''popup.htm'',''tus'',''330'','' 630'',''cactus.jpg'',''cactus'')">b2</a>Not precisely sure what the problem is - the usual culprit is use ofthe same name for both windows, but you didn''t do that. In any event,that script has whiskers on it, along with some oddities(''alwaysRaised'' only works with signed scripts, e.g.), and the code isabout as inefficient as possible. Nothing for the JS-disabled either.Try this:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd"><html><head><title>untitled</title><script type="text/javascript">function openPop(pD, nome, w, h, tD){var features = [''scrollbars=no'' ,''menubar=no'' ,''resizable=no'' ,''left=''+Math.floor(screen.width/2-w/2) ,''top=''+Math.floor(screen.height/2-h/2) ,''width='' + w,''height='' + h].join('','');HTML = [''<html>'' ,''<head>'' ,''<title>''+tD+''</title>'' ,''</head>'' ,''<body style="margin:0;">'' ,''<img src="''+pD+''" width="''+w+''" height="''+h+''" title="''+tD+''">'' ,''</body>'' ,''</html>''].join('''');nw = window.open(''javascript:opener.HTML'', nome, features);if (nw && !nw.closed && nw.focus)nw.focus();return false;}</script></head><body><a href="desert.jpg" onclick="returnopenPop(this.href,''des'',''499'',''610'',''desert'')">b1</a><a href="cactus.jpg" onclick="returnopenPop(this.href,''tus'',''330'',''630'',''cactus'')">b2</a></body></html>Don''t use pop-ups, blah blah blah...I''ll spare you the lecture. 这篇关于动态弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-11 03:51