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 > Javascript guru, I need you!!
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Javascript guru, I need you!!

Bene, dopo questo spendido titolo :D passo a esporvi il problema...

Ho un elemento della mia pagina web creato in questo modo:

<div class="item">
<div class="item-header">Titolo</div>
<p>Testo</p>
</div>

Nel foglio di stile imposto colori, sfondo, bordo ma senza scegliere l'altezza o il posizionamentio che rimangono quindi rispettivamente su 'auto' e 'static'.
Dopodiché voglio eseguire delle operazioni con il paragrafo contenente il testo, e quando vado a misurare la proprietà offsetHeight tramite Javascript mi restituisce 51px... peccato che invece l'altezza misurata empiricamente (compreso padding e border) sia di 40px, cioè ben 11 in meno.

Qualcuno mi sa spiegare questo fenomeno?

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

10-10-2007 12:48
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe 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.20 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

Provato sia con IE che con FF?
Qui dice che offsetHeight non fa parte del DOM, benché sia cross-browser.

Hai provato a leggere tutti gli attributi attraverso il DOM? Magari qualcosa salta fuori.

P.S.: Conosco poco di JS :D

__________________
?

10-10-2007 13:41
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
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Si, so che non è standard la proprietà offsetHeight, ma è stata ormai implementata da tutti i browser.

Altre proprietà sono clientHeight e simili, ma tutte riportano un valore che è sballato rispetto alla dimensione reale!

Provato con IE, FF e Opera! :(

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

10-10-2007 15:12
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe 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.20 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

Allora non saprei :alsono: mi spiace

__________________
?

10-10-2007 16:42
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
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.10 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

100 visite e nessuno che mi sa rispondere! :asd:
Comunque alla fine ho risolto in maniera ortodossa, togliendo il 10% dall'altezza! :)

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

13-10-2007 20:39
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 15:13.    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.336 seconds (71.68% PHP - 28.32% MySQL) con 23 query.