Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem, Dlaczego to działa w ff a nie działa w IE
Black-Berry
post
Post #1





Grupa: Zarejestrowani
Postów: 663
Pomógł: 6
Dołączył: 3.06.2007
Skąd: Kraków

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


jak w temacie

  1. <title>...</title>
  2. <script type="text/javascript">
  3. var now = false;
  4.  
  5. function show(id, event)
  6. {
  7. hide();
  8. document.getElementById(id).style.display = 'block';
  9. now = id;
  10. event.stopPropagation();
  11. }
  12.  
  13. var tag;
  14.  
  15. function hide()
  16. {
  17. if(now)
  18. {
  19. document.getElementById(now).style.display = 'none';
  20. }
  21. }
  22. </head>
  23. <body onclick="hide();">
  24. <div onclick="event.stopPropagation();" id="jeden" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf1</div>
  25. <div onclick="event.stopPropagation();" id="dwa" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf2</div>
  26. <div onclick="event.stopPropagation();" id="trzy" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf33</div>
  27.  
  28. <br />
  29. <a href="#null" onclick="show('jeden', event);">jeden</a><br />
  30. <a href="#null" onclick="show('dwa', event);">dwa</a><br />
  31. <a href="#null" onclick="show('trzy', event);">trzy</a><br />
  32. </body>
  33. </html>


Ten post edytował Black-Berry 12.06.2007, 12:27:49
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
abc667
post
Post #2





Grupa: Zarejestrowani
Postów: 229
Pomógł: 0
Dołączył: 29.05.2007

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


  1. <title>...</title>
  2. <script type="text/javascript">
  3. var now = false;
  4.  
  5. function show(id, event)
  6. {
  7. hide();
  8. document.getElementById(id).style.display = 'block';
  9. now = id;
  10. stopEvent(event);
  11. }
  12.  
  13. var tag;
  14.  
  15. function hide()
  16. {
  17. if(now)
  18. {
  19. document.getElementById(now).style.display = 'none';
  20. }
  21. }
  22.  
  23. function stopEvent(event)
  24. {
  25. if (event.stopPropagation) {
  26. event.stopPropagation();
  27. } else {
  28. event.cancelBubble = true;
  29. }
  30. }
  31. </head>
  32. <body onclick="hide();">
  33. <div onclick="stopEvent(event);" id="jeden" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf1</div>
  34. <div onclick="stopEvent(event);" id="dwa" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf2</div>
  35. <div onclick="stopEvent(event);" id="trzy" style="width: 50%; height: 50%; border: 1px solid black; display: none;">fdf33</div>
  36.  
  37. <br />
  38. <a href="#null" onclick="show('jeden', event);">jeden</a><br />
  39. <a href="#null" onclick="show('dwa', event);">dwa</a><br />
  40. <a href="#null" onclick="show('trzy', event);">trzy</a><br />
  41. </body>
  42. </html>
Go to the top of the page
+Quote Post
Black-Berry
post
Post #3





Grupa: Zarejestrowani
Postów: 663
Pomógł: 6
Dołączył: 3.06.2007
Skąd: Kraków

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


normalnie wiszę Ci piwo (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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: 23.08.2025 - 02:05