Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] Odczytanie szerokości ramki
Muniek
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.02.2005

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


A ja mam pytanie (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

Czy JS ma możliwość odczytania szerokości jednej ramki?

To znaczy: mam stronę podzieloną w układzie np. * | 600 | *. I chodzi mi o to, czy da się odczytać jakimś sposobem szerokość ramek, których szerokość we frameset jest zdefiniowana przez * ?

Próbowałem, ale nie wpadłem na to.... (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Ten post edytował Muniek 13.02.2005, 04:20:11
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dr_bonzo
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


Niestey dziala tylko pod Firefoxem
  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="en">
  3. <!--
  4. author me
  5. firefox: ok
  6. -->
  7. <head>
  8. <script type="text/javascript">
  9.  
  10. function obliczWielkosciRamek()
  11. {
  12. frameset = document.getElementById( 'fr_set' );
  13.  
  14. frames = frameset.getElementsByTagName( 'frame' );
  15.  
  16. results = "";
  17.  
  18. for ( i = 0; i < frames.length; i++ )
  19. {
  20. // firefox
  21. results += frames[ i ].id + ": " + frames[ i ].scrollWidth + "px\n";
  22. // results += frames[ i ].name + ": " + frames[ i ].offsetWidth + "px\n";
  23.  
  24. // opera
  25. //results += frames[ i ].name + ": " + frames[ i ].offsetWidth + "px\n";
  26. }
  27.  
  28. alert( results );
  29.  
  30. }
  31. </script>
  32. </head>
  33. <frameset cols="*, 600, *" onload="obliczWielkosciRamek()" id="fr_set">
  34. <frame src="01.html" id="frame_01" name="frame_01"/>
  35. <frame src="02.html" id="frame_02" name="frame_02" />
  36. <frame src="03.html" id="frame_03" name="frame_03" />
  37. </html>


lub... drugie rozwiazanie za chwile
No jednak go nie bedzie -- nie potrafie.

Ten post edytował dr_bonzo 13.02.2005, 19:34:16
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: 10.10.2025 - 10:42