Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
js pitanje

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 29.08.2004 18:07    Post subject: js pitanje Add user to your forum ignore list Reply with quote

imam jedan mali problemcic vezan za js, znaci ovako ....

imam jedan prozor koji se otvori (popup) i u njemu se iz . txt (php) upiše neki sadržaj (u tablicu) ... tablica nema definiran height pa se proširi po potrebi 'teksta'...
sad bi ja trebo da js 'uzme' veličinu tablice i prilagodi veličinu prozora tablici ...

help me do!!1

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 29.08.2004 19:04    Post subject: Add user to your forum ignore list Reply with quote

hmm neš sam skužio al ne radi 'do kraja'

Code:
function wee(){
   h = document.getElementById('cell').height;
   h2 = h + 30 + 22 + 10;
   screen.height=h2;
   screen.width=430;
   }


what's the problem? Smile

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 29.08.2004 21:35    Post subject: Add user to your forum ignore list Reply with quote

Ovisno od browsera, problema moze biti vise... screen objekt nije svuda podrzan, a niasm siguran cak ni da je u exploreru... Tebi treba window objekt i to novo otvorenog prozora...

Prosnjofaj ovdje: http://www.webreference.com/js/tutorial1/features.html pa vidi, no mislim da ti je zbog razlika u browserima bolje koristiti window.resizeTo() metodu... Detaljnije ovdje: http://www.webreference.com/js/tutorial1/manipulate.html

Dakle, uzmes ovisno o browseru sirinu tablice, dodas ovo kaj ti treba i pozoves window.resizeTo() sa novim dimenzijama... HTH

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 29.08.2004 22:02    Post subject: Add user to your forum ignore list Reply with quote

zytzagoo wrote:

Dakle, uzmes ovisno o browseru sirinu tablice, dodas ovo kaj ti treba i pozoves window.resizeTo() sa novim dimenzijama... HTH


prvotno sam i uzeo resizeTo ali to isto nije radilo, pa sam promjenio u screen... (ko onaj vic - 'informatičar: oćemo izać, pa uć u auto, možda proradi' Smile), ali ako ti kažeš tako budem onda i koristio resizeTo...

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 29.08.2004 22:38    Post subject: Add user to your forum ignore list Reply with quote

Hmm... u najgorem slucaju, mozes napraviti provjeru koji je browser u pitanju, pa ovisno o tome raditi ono sto sigurno radi u tom browseru..

Sutra ujutro ti sibnem komad koda koji radi slicnu stvar, ali za micanje prozora ako ga nadjem, sad sam doma i neda mi se razmisljat previse Smile, a ovo mi u firmi ostalo od zadnjeg weba jednog sto sam radio, prije nego sam na godisnji isao...

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 30.08.2004 08:24    Post subject: Add user to your forum ignore list Reply with quote

Ne mogu naci tocan kod... ako se dobro sjecam, ovako nekako je stvar isla...
Code:
if (typeof(window.innerWidth) == 'number') {
        // Non-IE
        window_width = window.innerWidth;
        window_height = window.innerHeight;
    } else if (document.documentElement &&
        (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ u 'standards compliant mode' -u
        window_width = document.documentElement.clientWidth;
        window_height = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight )) {
        //IE 4 compatible
        window_width = document.body.clientWidth;
        window_height = document.body.clientHeight;
    }
}


Moguce je da sam nesto i zajebo u cijeloj prici. Jos je rano, a i to sa prozorima je zajebana stvar, a da radi svuda kako spada LeaveMeBe

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 30.08.2004 10:17    Post subject: Add user to your forum ignore list Reply with quote

tenks, budem to probo no ustvari nije problem s 'visinom' prozora nego to što js uzme vrijednost dužine tablice (ćelije svjed.) onu koju sam ja sam definiro, a ako se tablica sama proširi zbog više teksta to ne prepozna i kaže da vrijednost nije definirana ...

možeš pliz objasnit malo kaj je to innerWidth ? Smile


help, or i will jump from my house Sad pljk :givap

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 30.08.2004 10:39    Post subject: Add user to your forum ignore list Reply with quote

Pretpostavljam da mislis na visinu tablice? Preporucam da pokusas dohvatiti visinu ovako:
Code:
h = document.getElementById('cell').offsetHeight;

to bi ti trebalo vratiti stvarnu visinu elementa... Barem u browserima koji podrzavaju getElementById(). Za starije browsere ce ti trebati dodatnih funkcija i drugaciji pristup, detaljnije imas ovdje: http://www.aspandjavascript.co.uk/javascript/javascript_api/get_element_width_height.asp

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 30.08.2004 10:40    Post subject: Add user to your forum ignore list Reply with quote

innerWidth: http://www.mozilla.org/docs/dom/domref/dom_window_ref28.html recimo, ili bilo kaj drugo s google-a Smile

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 30.08.2004 12:23    Post subject: Add user to your forum ignore list Reply with quote

puno tenks, ak sad nebude radilo Very Happy

edit: e, još nešto Very Happy ima di na internetu vidjet koji browser što podržava ...

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 30.08.2004 12:33    Post subject: Add user to your forum ignore list Reply with quote

Dobar pocetak imas ovdje mozda: http://www.quirksmode.org/browsers/contents.html

Takodjer, ovo meni super za dosta toga javascript related: http://www.quirksmode.org/js/contents.html

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
unique



Joined: 29 Mar 2004
Posts: 655

PostPosted: 30.08.2004 12:57    Post subject: Add user to your forum ignore list Reply with quote

radi Smile
offset je to što mi je trebalo , a što se tiče getElementById radi i u ff i ie (u operi ne radi uopće window.open ... mislim otvara ga u novom 'tabu' ali boli me k za operu Smile )

puno hvala, dužan sam ti Wink Smile

_________________
Activate interlock! Dynotherms connected! Infracells up! Mega thrusters are go! LET'S GO VOLTRON FORCE!
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group