470,643 Members | 1,359 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,643 developers. It's quick & easy.

Domanda su script che indirizza in base a risoluzione

Imposto qui la domanda che avevo erroneamente impostato in un ng Java.
Qualcuno mi saprebbe dire perchŤ lo script seguente funziona bene per
risoluzione 800x600, indirizzando alla pagina index_800.htm, funziona
bene per le risoluzioni piý alte, indirizzando alla pagina index.htm,
ma NON funziona se la risoluzione Ť 640x480, nel qual caso presenta la
pagina index.htm?
L'ho provato su 3PC, ma il risultato Ť sempre lo stesso.
Grazie molte in anticipo a tutti coloro che mi risponderanno
-------------------------

<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height

if (s_width == "640"){
location.href="index_640.htm";
}

if (s_width == "800"){
location.href="index_800.htm";
}

else {
location.href="index.htm";
Jul 20 '05 #1
1 1154
Dante wrote on 07 feb 2004 in comp.lang.javascript:
<script language="javascript">
<!--
var s_width ='';
var s_height ='';
s_width=screen.width
s_height=screen.height

if (s_width == "640"){
location.href="index_640.htm";
}

if (s_width == "800"){
location.href="index_800.htm";
}

else {
location.href="index.htm";


} // !!!
Molto simplificato :

<script type="text/javascript">
var s_width=screen.width;
if (s_width < 641)location.href="index_640.htm";
if (s_width < 801)location.href="index_800.htm";
location.href="index.htm";
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dmitry | last post: by
reply views Thread by :crp: | last post: by
3 posts views Thread by caldera | last post: by
3 posts views Thread by Michael A. Vickers | last post: by
1 post views Thread by Jose Reckoner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.