"Daniele petracca" <pa****@panservice.it> writes:
<SCRIPT TYPE="text/javascript">
if (screen.width==1024) {
distanza=100;
sinistra=100;
}
else {
distanza=10;
sinistra=10;
}
document.write(screen.width);
</script>
...
< href="noJS.html"
onclick="apri('frametotali.htm','finestra1','width =790,height=565,top=?,left
=?,toolbar=no,resizable=no');">
I wanna make a choice
if resolution is 1024x768 distanza and sinistra will get 100 as value
if resolution is 800x600
.... or *any* other resolution, including 1600x1200 and up ...
distanza and sinistra will get 10 as value
How can i apply those values to the top and left of the popup opened by the
onclick?
Easy. But before telling you how, I'll tell you why not :)
I use Opera in MDI mode. That means that all new page windows are
opened inside the Opera application window. That means that the screen
resolution has *no* impact on the browser window size, not even for
newly opened windows. I run my screen at 1600x1200, but my browser is
only about 800 pixels wide.
Your values (10 or 100) are not bad. If I keep my browser at 800 pixels
wide, I will be able to see the entire opened window (790px wide and
at 10px from the left). If you changed 1600x1200 to also set distanza
to 100, then I would miss 90 pixles of the window.
Generally, you should let the browser position new windows. It knows the
user's setup better than you ever will.
Anyway, if you insist:
onclick="apri('frametotali.htm','finestra1','width =790,height=565,'+
'top='+distanza+',left='+sinistra+',toolbar=no,res izable=yes');">
There is no good reason to not make the window resizable. Don't try to
control the user's machine. If he wants to resize, let him, or he will
just get irritated.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'