Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

2 Stron V  < 1 2  
Reply to this topicStart new topic
> [js] Poszukuję dobrego, sprawdzonego...
Jarod
post 18.03.2008, 16:54:55
Post #21





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

Ostrzeżenie: (0%)
-----


Cytat(siemakuba @ 18.03.2008, 16:51:04 ) *
Trzeba by pewnie potestować co będzie poprawne dla której przeglądarki, bo do wyboru mamy innerHeight / scrollHeight / offsetHeight / style.height i jeszcze pewnie coś by było.

Rozumiem. Gdzię znajdę spis wszystkich tych znaczników? I nawet jeśli dopasuję kilka poprawnie działających to jak zapisać warunki dla każdej przeglądarki osobno?

Cytat(siemakuba @ 18.03.2008, 16:51:04 ) *
To z kolei prowadzi nas do sedna tego właśnie wątku - użycia biblioteki, która to wie i wybierze za nas co potrzeba.
Jak pisałem korzystam z jQuery i szczerze polecam. Ale mi się nie chce już walczyć, ja chcę żeby było wygodnie, szybko i dobrze winksmiley.jpg

Niby tak, ale:
-zmuszasz się do wrzucania całości do swojego projektu
-jquery umie tylko chyba obrazki (galerię zdjęć) w ten sposób wyświetlać.

Będziesz tak miły i podasz linka do dokumentacji, gdzie jest opisane zastosowanie takiego rozwiązania?

pzdr


--------------------
”Godzina nauki w życiu nowoczesnego apostoła jest godziną modlitwy.”
(św. Josemaría Escrivá, Droga, 335)
Go to the top of the page
+Quote Post
Jarod
post 18.03.2008, 21:55:33
Post #22





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

Ostrzeżenie: (0%)
-----


Cytat(siemakuba @ 18.03.2008, 16:58:46 ) *
@Jarod, poczekasz do wieczora? Nie dam rady teraz winksmiley.jpg
pozdr.

Oczywiście

Mam coś takiego ale pod każdą przeglądarką wygląda inaczej... Macie jakieś pomysły?

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <meta http-equiv="Content-Language" content="pl" />
  5. <meta name="Robots" content="all" />
  6. <meta name="Pragma" content="no-cache" />
  7. <meta name="Cache-Control" content="no-store, no-cache, must-revalidate" />
  8.  
  9. <link rel="stylesheet" href="overlay.css" type="text/css" />
  10. </head>
  11. <body onload="document.getElementById('loading').style.height=document.body.scrollHeight+'px';document.getElementById('loading').style.width=document.body.offsetWidth+'px';">
  12.  
  13. <?php
  14. echo '<div id="loading"></div>';
  15.  
  16. echo '<div id="test">';
  17. //echo '<div id="test" style="width: 100px;">';
  18. ?>
  19. What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  20. What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  21. <?php
  22. echo '</div>';
  23.  
  24. ?>
  25.  
  26. </body>
  27. </html>



  1. html, body, * {
  2. font-size: 12px;
  3. }
  4.  
  5. div#loading {
  6. color: #000000;
  7. background-color: #000000;
  8. position: absolute;
  9. top: 0px;
  10. left: 0px;
  11. z-index: 10000;
  12. filter: alpha(opacity=70);
  13. -moz-opacity: 0.7;
  14. opacity: 0.7;
  15. }


Jak nie ma pionowego suwaka przewijania to wogóle lipa.


--------------------
”Godzina nauki w życiu nowoczesnego apostoła jest godziną modlitwy.”
(św. Josemaría Escrivá, Droga, 335)
Go to the top of the page
+Quote Post
siemakuba
post 19.03.2008, 01:04:31
Post #23





Grupa: Przyjaciele php.pl
Postów: 1 112
Pomógł: 20
Dołączył: 10.04.2005

Ostrzeżenie: (0%)
-----


Cytat(Jarod @ 18.03.2008, 16:54:55 ) *
Rozumiem. Gdzię znajdę spis wszystkich tych znaczników? I nawet jeśli dopasuję kilka poprawnie działających to jak zapisać warunki dla każdej przeglądarki osobno?

Np. tu:
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
http://msdn2.microsoft.com/en-us/library/m...055(VS.85).aspx
Cytat(Jarod @ 18.03.2008, 16:54:55 ) *
Niby tak, ale:
-zmuszasz się do wrzucania całości do swojego projektu
-jquery umie tylko chyba obrazki (galerię zdjęć) w ten sposób wyświetlać.

Będziesz tak miły i podasz linka do dokumentacji, gdzie jest opisane zastosowanie takiego rozwiązania?


Wrzucenie całości jQuery? To niewielkie obciążenie dla transferu - wersja spakowana to niecałe 30kb.
Czy umie tylko obrazki? Nie doceniasz ;) http://jquery.com/demo/thickbox/

pozdr.
Go to the top of the page
+Quote Post
NoiseMc
post 19.03.2008, 05:22:46
Post #24





Grupa: Zarejestrowani
Postów: 398
Pomógł: 10
Dołączył: 24.11.2004
Skąd: Łódź

Ostrzeżenie: (0%)
-----


Zobacz tutaj metode getHeight () i jak wykorzystuje ja w showLoading () moze pomoc z ustalaniem wysokosci okna

http://www.laurarosephotography.com/javasc.../Ajax/common.js


BTW ... po co echo-ujesz HTML ?

Ten post edytował NoiseMc 19.03.2008, 05:33:48


--------------------
Go to the top of the page
+Quote Post
Jarod
post 19.03.2008, 14:19:23
Post #25





Grupa: Zarejestrowani
Postów: 1 190
Pomógł: 27
Dołączył: 23.04.2005

Ostrzeżenie: (0%)
-----


Cytat(siemakuba @ 19.03.2008, 01:04:31 ) *
Np. tu:
http://developer.mozilla.org/en/docs/Gecko_DOM_Reference
http://msdn2.microsoft.com/en-us/library/m...055(VS.85).aspx
Wrzucenie całości jQuery? To niewielkie obciążenie dla transferu - wersja spakowana to niecałe 30kb.
Czy umie tylko obrazki? Nie doceniasz winksmiley.jpg http://jquery.com/demo/thickbox/

pozdr.

Te strony to widziałem - myślałem, że jest coś więcej. Co do thickbox'a to także widziałem. Chciałem sam ugryźć temat. Dzięki za poświęcony czas winksmiley.jpg


Cytat(NoiseMc @ 19.03.2008, 05:22:46 ) *
Zobacz tutaj metode getHeight () i jak wykorzystuje ja w showLoading () moze pomoc z ustalaniem wysokosci okna

http://www.laurarosephotography.com/javasc.../Ajax/common.js
BTW ... po co echo-ujesz HTML ?


@NoiseMc: Ten skrypcik co podałeś, działa super w FF, jak się doda dodatkowo 30px do wyniku pageHeight (return pageHeight+30;) to działa dobrze w IE. Natomiast Opera kaszani się (na dole zostaje około centymetr białego paska - niezasłoniętego).

Co do drugiego Twojego pytania.. Kod, który podawałem skopiowałem ze skryptu, żeby nie pisać od początku. Trafiłem na skrypt, w którym dużo warunków za pomocą php jest sprawdzanych, a tam gdzie większość kodu generowana w php nie wychodzę z php tylko treść wyświetlam za pomocą echo - podobno lepiej wyświetlać strukturę (czyt. szybciej) dokumentu za pomocą echo niż otwierać i zamykać często sekcję php (<?php ?>).




ROZWIĄZANIE PROBLEMU:
index.php
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <meta http-equiv="Content-Language" content="pl" />
  5. <meta name="Robots" content="all" />
  6. <meta name="Pragma" content="no-cache" />
  7. <meta name="Cache-Control" content="no-store, no-cache, must-revalidate" />
  8.  
  9. <link rel="stylesheet" href="index.css" type="text/css" />
  10. <!--[if gte IE 6]><link rel="stylesheet" href="index_ie.css" type="text/css" /><![endif]-->
  11.  
  12. </head>
  13.  
  14. <div id="loader"></div>
  15. <!-- DODATKOWY BLOK POTRZEBNY DLA IE ŻEBY NIE IGNOROWAŁ MARGINESÓW !!! -->
  16. <div>
  17. <div id="content">
  18. What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). Where does it come from? Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.
  19. To jest przykładowy tekst
  20. </div>
  21. </div>
  22.  
  23. </body>
  24. </html>


index.css
  1. div#loader {position: fixed; top:0px; left:0px; background: #000000; width:100%; height:100%; z-index:9999;
  2. filter:alpha(opacity=60); -moz-opacity:0.6; opacity: 0.6;}
  3.  
  4. div#content {margin: 30px auto 0 auto; width: 200px; min-height: 500px; height: auto; color: #000000;
  5. background-color: red;}


index_ie.css
  1. body { margin: 0; padding:0; width: 100%; height:100%; overflow-y:auto;}
  2. html {overflow-x:auto; overflow-y:hidden;}
  3. * html div#loader {position:absolute;}



Działa pod FF, Operą i IE. Stawiam wirtualnego browarka dla tego kto potrafi mi wytłumaczyć, dlaczego ten dodatkowy blok <div> w kodzie index.php jest potrzebny, aby IE nie olewał marginesów? winksmiley.jpg

Pozdrawiam


--------------------
”Godzina nauki w życiu nowoczesnego apostoła jest godziną modlitwy.”
(św. Josemaría Escrivá, Droga, 335)
Go to the top of the page
+Quote Post

2 Stron V  < 1 2
Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.04.2024 - 10:26