Hi.
I have a page that contains this simple function:
<script language="javascript">
function openPop(url, name, w, h) {
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=no,";
features += "width=" + w + ",";
features += "height=" + h;
nw = window.open(url, name, features);
}
</script>
Il opens a popup.htm using this system:
popup.htm?artist=picasso&type=maxi&nImg=3.jpg&w=49 9&h=300;
When the popup opens (it only contains an image!), it reads this url,
looks for the data and loads it into the window:
<script language='javascript'>
var qst=location.search.substr(1);
var dati = new Array()
dataInUrl=qst.split("&");
// artist name
var d1 = dataInUrl[0].substr(dataInUrl[0].indexOf("=")+1);
// folder type
var d2 = dataInUrl[1].substr(dataInUrl[1].indexOf("=")+1);
// image path
var d3 = dataInUrl[2].substr(dataInUrl[2].indexOf("=")+1);
// width
var d4 = dataInUrl[3].substr(dataInUrl[3].indexOf("=")+1);
// height
var d5 = dataInUrl[4].substr(dataInUrl[4].indexOf("=")+1);
</script>
</HEAD>
<BODY bgcolor="#000000" topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + path + "' border=0 height='"+d5+"'
width='"+d4+"'>" );
</script>
Everything gets loaded when wanted but:
1) the first image perfectly adheres to the border of the popup
2) when I call again the function (setting other dimensions for the
popup) I get the same dimensions as the first time I loaded the popup:
that is, if the first time I called a 300x300 popup and the second time
I specified a width of 450x340, I get again a popup 300x300 window (but
containing the right content!).
Is there any way to have the things working as I imagined? :-)
Thanks in advance,
ypress