Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js, css]Rozdzielczość
microh
post
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 5.11.2006

Ostrzeżenie: (10%)
X----


Uzywam tego kodu aby określić rozdzielczość i w zalezności od niej dołaczyc odpowiedni styl:
  1. <?php
  2. <script type="text/Javascript">
  3. if (screen.width < 1024) {
  4. document.write('<link rel=stylesheet type="text/css" href="lowFonts.css">');
  5. }
  6. if (screen.width >= 1024 && screen.width < 1280) {
  7. document.write('<link rel=stylesheet type="text/css" href="mediumFonts.css">');
  8. }
  9. if (screen.width >= 1280) {
  10. document.write('<link rel=stylesheet type="text/css" href="highFonts.css">');
  11. }
  12. </script>
  13. ?>

Wydaje mi sie prawidlowy, ale niestety nie dziala!!
Daje go w <head> i niestety....(IMG:http://forum.php.pl/style_emoticons/default/sad.gif) (IMG:http://forum.php.pl/style_emoticons/default/worriedsmiley.gif)
Jakies rady:( (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

Ten post edytował microh 19.02.2007, 15:27:35
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 8.10.2025 - 14:15