Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [js] problem ze zmienna
macza
post
Post #1





Grupa: Zarejestrowani
Postów: 236
Pomógł: 4
Dołączył: 1.05.2006
Skąd: Lublin

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


  1. function pokaz(kk){
  2.  
  3. if(document.getElementById( kk ).style.display=='block'){
  4. document.getElementById( kk ).style.display='none';
  5. }else{
  6. document.getElementById( kk ).style.display='block';
  7. if(kk<>'aa'){ document.getElementById( 'aa' ).style.display='none'; }
  8. if(kk<>'bb'){ document.getElementById( 'bb' ).style.display='none'; }
  9. if(kk<>'cc'){ document.getElementById( 'cc' ).style.display='none'; }
  10. if(kk<>'dd'){ document.getElementById( 'dd' ).style.display='none'; }
  11. if(kk<>'ee'){ document.getElementById( 'ee' ).style.display='none'; }
  12.  
  13. }
  14.  
  15. }
to moja funkcja pokazujaca divy uzywa sie jej tak:
<a href="java script:pokaz('cc');">
i wtedy div o id rownym cc pokazuje sie, ale jezeli jeszcze raz klikniemy na link to zniknie nam to okienko

tylko teraz jest problem, bo moge sobie zrobic 100 okienek, ale chcialbym aby na klikniecie w jedno okienko reszta sie chowala:
  1. }else{
  2. document.getElementById( kk ).style.display='block';
  3. if(kk<>'aa'){ document.getElementById( 'aa' ).style.display='none'; }
  4. if(kk<>'bb'){ document.getElementById( 'bb' ).style.display='none'; }
  5. if(kk<>'cc'){ document.getElementById( 'cc' ).style.display='none'; }
  6. if(kk<>'dd'){ document.getElementById( 'dd' ).style.display='none'; }
  7. if(kk<>'ee'){ document.getElementById( 'ee' ).style.display='none'; }

no ale nie wiem jak odwolac sie do kk bo wszystko jest git, ten fragment kk<>'aa',
Jak odwolac sie do zmiennej kk?? thx za odpwowiedz (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
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: 22.08.2025 - 16:55