Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [html] Ukrywanie DIVa - rozciąganie DIVa 2
-Gość_azpr_*-
post
Post #1





Goście







strona wygllada mniej więcej tak

http://www.fotosik.pl/pokaz_obrazek/846bb80129a1efc6.html

czerowne pole menu gdzie znajduje sie:

  1. <a href="java script:void(0); openClose('menu_1');">Pokaż</a>


niebieskie pole to jest własnie ukryty div:

  1. <script type="text/javascript">
  2. <!--
  3. function openClose(id)
  4. {
  5.   if(document.getElementById) {
  6.      element = document.getElementById(id);
  7.   } else if(document.all) {
  8.      element = document.all[id];
  9.   } else return;
  10.  
  11.   if(element.style) {
  12.      if(element.style.display == 'block' ){
  13.         element.style.display = 'none';
  14.      } else {
  15.         element.style.display = 'block';
  16.      }
  17.   }
  18. }
  19. -->
  20. </script>


a zielone pole to jest jakis div z zawartościa...

i teraz pytanie jak zrobić aby zielony div był rozciagniety do samego końca menu gdy div niebieski jest ukryty... a gdy jest widoczny aby sie zawartosc zmnijeszała na objetości ekranu...
Go to the top of the page
+Quote Post
hwao
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 2 844
Pomógł: 20
Dołączył: 25.11.2003
Skąd: Olkusz




zamieniasz style css (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Kod
element.style = 'width: 100%';

Albo poprostu id obiektu (i tez styl wtedy sie zmienia (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) )

tu masz przyklad, mozesz sobie podpatrzec source
http://hwao.be/blog2/
Go to the top of the page
+Quote Post

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: 22.08.2025 - 20:33