Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [CSS][JavaScript]style.block,none
neo1986kk
post
Post #1





Grupa: Zarejestrowani
Postów: 561
Pomógł: 3
Dołączył: 2.02.2009

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


  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2.  
  3. <html>
  4. <head>
  5. <title>Untitled</title>
  6.  
  7. <style type="text/css">
  8. <!--
  9. #dropper { display: none; }
  10. -->
  11. </style>
  12.  
  13. <script language="JavaScript" type="text/javascript">
  14. <!--
  15. function toggleDiv(element){
  16. if(document.getElementById(element).style.display = 'none')
  17. {
  18. document.getElementById(element).style.display = 'block';
  19. }
  20. else if(document.getElementById(element).style.display = 'block')
  21. {
  22. document.getElementById(element).style.display = 'none';
  23. }
  24. }
  25. //-->
  26. </script>
  27.  
  28. </head>
  29. <body>
  30. <div onClick="toggleDiv('dropper')">Main</div>
  31.  
  32. <div id="dropper">
  33. <ul>
  34. <li>1</li>
  35. <li>2</li>
  36. </ul>
  37. </div>
  38. </body>
  39. </html>


Dlaczego po ponownym naciśnięciu nie chowa elementu <div id="dropper">??
Kod wydaje sie poprawny, konsola nie wyświetla błedów, sprawdzane na FF
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: 26.09.2025 - 22:54