Grey_Wolf Posted April 5, 2008 Report Share Posted April 5, 2008 nu taa . nepiecieshams ar JS palidziibu dabuut lapas realos izmerus (pikseljos) Nevis Loga, bet pasa dokumenta. piedevam njemot vera ka tie var dinamiski izmainities (tikt uzgenerets jauns elements) Varbut kadam ir idejas: Mate gogle daudz stasta kaa dabuut loga izmerus , bet par realo dokumenta izmeru faktiski neko netradu , iespejams ka ne tur mekleju ... Link to comment Share on other sites More sharing options...
marrtins Posted April 5, 2008 Report Share Posted April 5, 2008 jQuery + Dimensions plukkin + window resize events Link to comment Share on other sites More sharing options...
bubu Posted April 5, 2008 Report Share Posted April 5, 2008 A kas ir dokumenta izmērs? Ja vienā paragrāfā (<p>) būs ierkastīti daudz daudz teikumi pēc kārtas, tad dokumenta platums būs šī paragrāfa teksta garums vienā rindā? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 6, 2008 Author Report Share Posted April 6, 2008 njaa vakar nepreciizi izsstastiju..... Taatd vajag lapas platumu , ne tikai to kas ir patreiz redzams bet arii to kas paliek 'aiz loga' (aizscrolets) , tas pats uz augstumu ... ja lapa teiksim buus gigantiska bilde (3000X6000 px ) un blakus, un apaksa vel kautkas , tad lai arii atgriezj tos (3000+ ?? ) X (6000 + ? ) neskatoties cik lielu dalju useris patreiz redz.... ja buus tikai 1 simbols , bet 'logs' pa visu ekranu tad lai atgriez loga platumuX augstumu --> so varetu atrisinat, ja zinatu vai scroleri patreiz ir redzami (aktivi) ..... ------------ marrtins --> arejie frimworki neder :( , bet paldies par ieteikumu, varbut ko izdosies izkasiit.... ------------- Link to comment Share on other sites More sharing options...
bubu Posted April 6, 2008 Report Share Posted April 6, 2008 Nu tādā gadījumā tev palīdzēs element.offsetWidth un element.offsetHeight. Link to comment Share on other sites More sharing options...
marrtins Posted April 6, 2008 Report Share Posted April 6, 2008 Yup, kaukā tā: <div id="a" style="position:absolute; top:0; left:0;"> <div style="position:relative;width: 3600px; height: 3600px;" onclick="alert(document.getElementById('a').clientWidth);">HAHA HEHE</div> </div> Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 6, 2008 Author Report Share Posted April 6, 2008 bubu & marrtins --> garam :( element.offsetWidth --> atgriezj REDZMO loga izmeru ... man vajag VISU arii to kas paliek aizz scrolaa... (gan vienaa pusee (sakuma :window.pageYOffset) gan arii vel taja kas nav skatiita (labaa puse/apaksa) ) ---------- Tur arii visa sape paraadaas... Link to comment Share on other sites More sharing options...
marrtins Posted April 6, 2008 Report Share Posted April 6, 2008 A Tu patestē :P Tāpē jau ir viens absolute un otrs relative. Link to comment Share on other sites More sharing options...
bubu Posted April 6, 2008 Report Share Posted April 6, 2008 Nezinu, ko tu tur čakarē, bet man šāds html fails: <html> <body> <p id="asdf" style="overflow:visible; width:2000px;"> asdf </p> <script> alert(document.getElementById("asdf").offsetWidth); </script> </body> </html> izvada skaitli 2000, kaut arī mana displeja izšķirtspēja ir 1680x1050. Browseris, protams, attēlo horizontalu skrollbaru šajā gadījumā, lai varētu tikt pie satura, kas iziet ārpus monitora. Link to comment Share on other sites More sharing options...
indoom Posted April 7, 2008 Report Share Posted April 7, 2008 Ja jau lapas izmēru vajag, varbūt šis der. Ņemts, liekas, no quirksmode sen atkapaļ. function getPageSize() { var xScroll,yScroll; if (window.innerHeight && window.scrollMaxY) { xScroll = document.body.scrollWidth; yScroll = window.innerHeight + window.scrollMaxY; } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; } return [ xScroll, yScroll ]; } Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 7, 2008 Author Report Share Posted April 7, 2008 indoom --> tas ir tas kas vajadziigs ..... meklejo nebiju 'uzduries' --> scrollMaxY .... tas bija nepieciesamais posms ;) Link to comment Share on other sites More sharing options...
Recommended Posts