Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [HTML+javascript] perchè da mozilla non funziona?
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.88 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:42:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[HTML+javascript] perchè da mozilla non funziona?

come da oggetto, questo è il codice:

code:
<!DOCTYPE HTML SYSTEM "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>test</title> <Link rel="stylesheet" type="text/css" href="bannerDefault.css"/> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <script type="text/javascript"> function paint(){ var r = document.cp.red.value; var g = document.cp.green.value; var b = document.cp.blue.value; var bw = document.cp.colorbox; var rok = true; var gok = true; var bok = true; if(0>r || r>255){ alert("RED has an INVALID value: it need to be between 0 and 255"); rok = false; } if(0>g || g>255){ alert("GREEN has an INVALID value: it need to be between 0 and 255"); gok = false; } if(0>b || b>255){ alert("BLUE has an INVALID value: it need to be between 0 and 255"); bok = false; } if(rok && gok && bok){ document.getElementById("colorbox").style.backgroundColor='rgb('+r+','+g+','+b+')'; } } function resize(){ var h = document.cp.thumbHeight.value; var w = document.cp.thumbWidth.value; var hok = true; var wok = true; if(h<50 || h>300){ alert("HEIGHT has an INVALID value: it need to be between 50 and 300"); hok = false; } if(w<50 || w>300){ alert("WIDTH has an INVALID value: it need to be between 50 and 300"); wok = false; } if(wok){ document.getElementById("colorbox").style.width=w; alert(document.getElementById("colorbox").style.width); document.getElementById("colorbox").style.width=w; } if(hok){ document.getElementById("colorbox").style.height=h+''; } } </script> </head> <body onload="paint(), resize()"> <form method="post" action="test.html" name="cp"> <table class="gallery"> <tr> <td colspan="2" style="font-weight:bold;"> Dimensioni Icone </td> </tr> <td style="width:50%; text-align:right; border:0px solid blue"> Width : </td> <td style="width:50%; text-align:left; border:0px solid blue"> <input name="thumbWidth" value="250" style="border:1px solid gray" maxlength="3" size="3" onChange="resize()"> px </td> </tr> <tr> <td style="width:50%; text-align:right; border:0px solid blue"> Height : </td> <td style="width:50%; text-align:left; border:0px solid blue"> <input name="thumbHeight" value="150" style="border:1px solid gray" maxlength="3" size="3" onChange="resize()"> px </td> </tr> <tr> <td colspan="2">   </td> </tr> <tr> <td colspan="2" style="font-weight:bold;"> Background </td> </tr> <tr> <td style="width:50%; text-align:right; border:0px solid blue"> Red : </td> <td style="width:50%; text-align:left; border:0px solid blue"> <input name="red" value="255" style="border:1px solid gray; color:red" maxlength="3" size="3" OnKeyUp="paint()"> px </td> </tr> <tr> <td style="width:50%; text-align:right; border:0px solid blue"> Green : </td> <td style="width:50%; text-align:left; border:0px solid blue"> <input name="green" value="200" style="border:1px solid gray; color:green" maxlength="3" size="3" OnKeyUp="paint()"> px </td> </tr> <tr> <td style="width:50%; text-align:right; border:0px solid blue"> Blue : </td> <td style="width:50%; text-align:left; border:0px solid blue"> <input name="blue" value="180" style="border:1px solid gray; color:blue" maxlength="3" size="3" OnKeyUp="paint()"> px </td> </tr> <tr> <td colspan="2" style="font-weight:bold;">   </td> </tr> <tr> <td colspan="2" style="font-weight:bold;"> Preview </td> </tr> <tr> <td colspan="2" align="center"> <div id="colorbox" style="border:1px solid red;">   </div> </td> </tr> </table> </form> </body> </html>

__________________
http://www.twitter.com/0m4r

19-02-2005 11:11
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

1) Quando, in resize(), cambi le dimensioni, oltre al valore della variabile aggiungi "px" (es [...].width = w + "px"; )
2) Nello stile del colorbox aggiungi i parametri che cambi nel codice java script: width, height e backgroundColor e assegna valori di default

Dimmi se va :)

__________________
?

19-02-2005 22:17
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.88 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:42:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by yeah
1) Quando, in resize(), cambi le dimensioni, oltre al valore della variabile aggiungi "px" (es [...].width = w + "px"; )


FANTASTICO, funziona. Anche se mi sembra un'assurdità non vederlo funzionare semplicemente per l'unità di misura. Comunque ora va!

Originally posted by yeah
2) Nello stile del colorbox aggiungi i parametri che cambi nel codice java script: width, height e backgroundColor e assegna valori di default

La funziona che mi colora il <div> funzionava anche prima, quindi problema risolto gia in partenza!


Originally posted by yeah
Dimmi se va :)

Va!

__________________
http://www.twitter.com/0m4r

20-02-2005 12:36
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.21 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Perfetto :)

__________________
?

20-02-2005 20:39
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 08:26.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.036 seconds (66.37% PHP - 33.63% MySQL) con 27 query.