473,394 Members | 1,226 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

how can i make a choice?

<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 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?

thank you
daniele
Jul 20 '05 #1
4 2592
"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.'
Jul 20 '05 #2

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
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.


There is one context in which a non-resizeable window is appropriate.
That is with pages that function as custom alert windows. In other
words, basic or no graphics, little text, and size no more than about
300x200 or so.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #3
"Fabian" <la****@hotmail.com> wrote in message
news:bm************@ID-174912.news.uni-berlin.de...
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.


There is one context in which a non-resizeable window is
appropriate. That is with pages that function as custom alert
windows. In other words, basic or no graphics, little text,
and size no more than about 300x200 or so.


That pre-supposes that you have control over the font size. As most CSS
capable browsers allow the user the option of overriding details like
font size with user style sheets it cannot be valid to assume that
whatever (or however little) text you put into that window it will still
all always be visible at 300x200 (Assuming the user's screen will
accommodate that anyway).

I tend to think of it like this: If you get the window the right size
the user will not attempt to re-size it (because it is already the right
size), so they will never care (maybe not even notice) whether it is
resizable or not, if you get the size wrong the user will need to
re-size it and will be annoyed if they cannot. As the window re-sizing
controls have negligible impact on the appearance of windows I can see
no reason for not leaving them re-sizeable.

On the other hand, should a pop-up window be being used as a custom
alert? Given the ever growing unreliability of pop-up windows (and the
need to provide an alternative for browsers that have no window.open
function) I would have though that DHTML within the window was a
considerably more reliable approach for a custom alert.

Richard.
Jul 20 '05 #4
thank to everybody
i solved my great problem and made a step ahead in javascript

thanks
daniele
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

198
by: Sridhar R | last post by:
>From technical point of view, I could not understand the the reasoning behind using Java in major companies. Sure that Python, is used in some, but still Java is considered as a sure-job...
3
by: dgaucher | last post by:
Hi, I want to consume a Web Service that returns a choice, but my C++ client always receives the same returned type. On the other hand, when I am using a Java client, it is working fine (of...
3
by: kosaraju.puneeth | last post by:
I want an element that must have either attribute A or B. <Thing1 A="aaa"/> <Thing1 B="bbb"/> I want to enforce this in my schema . If A and B were elements, I could use choice.
4
by: Dennis Vroegop | last post by:
Hi there! I have the following XSD (Well, this is not the real one, but the concept is the same....) <?xml version="1.0" encoding="UTF-8"?> <xs:schema...
1
by: Oleg Ogurok | last post by:
Hi all, I have a complex type defined as follows: <xs:complexType name="SchedulingMethodType"> <xs:choice maxOccurs="1"> <xs:element name="Interval" type="xs:duration" /> <xs:element...
4
by: Sergey Poberezovskiy | last post by:
Hi, As part of my schema I need to ensure that at least one of two fields have values. I defined my schema as follows: .... <xs:choice> <xs:element ref="el1"/> <xs:element ref="el2"/>...
7
by: rbarschaw | last post by:
I have the following schema designed: <xs:complexType name="AzzFeature-BoxType" mixed="true"> <xs:choice minOccurs="1" maxOccurs="unbounded"> <xs:element ref="Sub-Head" minOccurs="1"...
1
by: SL33PY | last post by:
Hi, I'm currently busy writing an xsd at one point in time i whish that my xml must look like: <object> <loc> <disk> <drive>c</drive> <path>temp\path</path> <files>*.*</files>...
2
by: hooomee | last post by:
Given: <xs:choice maxOccurs=5> <xs:element name="Foo" type="bar" /> <xs:element name="Foo1" type="bar" /> <xs:element name="Foo2" type="bar" /> </xs:choice> Is the choice made once and then...
0
by: Peter Larsen | last post by:
Is this really a valid schema design? <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="root">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.