Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: z-indexy pod ie6/ie7 zgłupiały
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
Fo
Witam,

Dopiero co pomógł mi mortus na forum xml,ajax a już mam drugi problem, którego znowu nie mogę pokonać.

Trochę kodu:

  1. #tabs .container {background:url(images/bg-container.jpg) repeat-x;padding:10px 0px 10px 10px;border:1px solid #ccc;position:relative;z-index:1;}
  2. #tabs .col {list-style:none;margin:0;padding:0;}
  3. #tabs .col li {float:left;width:240px;position:relative;}
  4. #tabs .col li a {position:relative;z-index:1;}
  5. #tabs .col .layer {position:absolute;}
  6. #tabs .col .showit {background:red;width:500px;height:100px;display:block;position:absolute;top:0;left:0;z-index:100;}
  7. #tabs .col .hideit {display:none;position:absolute;top:0;left:0;}
  8. .clear {clear:both;font-size:0;}


[JAVASCRIPT] pobierz, plaintext
  1. <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
  2.  
  3. $(document).ready(function(){
  4.  
  5. $("#tabs .trigger").click(function(){
  6. $(this).parent().find(".hideit").switchClass('hideit', 'showit', 200);
  7. $(this).parent().find(".showit").switchClass('showit', 'hideit', 0);
  8. return false;
  9. });
  10. $(".hideit").mouseout(function() {
  11. $(this).switchClass('showit', 'hideit', 0);
  12. });
  13.  
  14. });
[JAVASCRIPT] pobierz, plaintext


  1. <div id="tabs-2">
  2. <!-- container -->
  3. <div class="container">
  4. <ul class="col">
  5. <li>
  6. <a href="#" class="trigger">This is link</a>
  7. <span class="layer hideit">
  8. this is layer
  9. </span>
  10. </li>
  11. <li>
  12. <a href="#" class="trigger">This is other link</a>
  13. <span class="layer hideit">
  14. to jest dupka
  15. </span>
  16. </li>
  17. <li>
  18. <a href="#" class="trigger">This is another link</a>
  19. <span class="layer hideit">
  20. to jest dupka
  21. </span>
  22. </li>
  23. <li>
  24. <a href="#" class="trigger">And another one</a>
  25. <span class="layer hideit">
  26. here the same
  27. </span>
  28. </li>
  29. <li>
  30. <a href="#" class="trigger">and so on..</a>
  31. <span class="layer hideit">
  32. and here also
  33. </span>
  34. </li>
  35.  
  36. <li>
  37. <a href="#" class="trigger">This is link</a>
  38. <span class="layer hideit">
  39. this is layer
  40. </span>
  41. </li>
  42. <li>
  43. <a href="#" class="trigger">This is other link</a>
  44. <span class="layer hideit">
  45. this is layer too
  46. </span>
  47. </li>
  48. <li>
  49. <a href="#" class="trigger">This is another link</a>
  50. <span class="layer hideit">
  51. and this is another
  52. </span>
  53. </li>
  54. <li>
  55. <a href="#" class="trigger">And another one</a>
  56. <span class="layer hideit">
  57. here the same
  58. </span>
  59. </li>
  60. <li>
  61. <a href="#" class="trigger">and so on..</a>
  62. <span class="layer hideit">
  63. and here also
  64. </span>
  65. </li>
  66.  
  67. <li>
  68. <a href="#" class="trigger">This is link</a>
  69. <span class="layer hideit">
  70. this is layer
  71. </span>
  72. </li>
  73. </ul>
  74. <div class="clear"></div>
  75. </div>
  76. <!-- //container -->
  77. <div class="clear"></div>
  78. </div>
  79.  


Problem dotyczy IE6/IE7 - IE8 już nie.
Zobaczcie sobie jak to działa pod FF, nie zapomnijcie dołączyć sobie jquery bo ta warstwa się pokazuje dopiero po kliknięciu - czyli jquery niezbędne.

W momencie jak klikam na jakiś link to się pokazuje warstwa i ona przykrywa wszystko swoją szerokością i wysokością.
Niestety w IE6/IE7 jest jakby prześwit pozostałych linków i nie wiem jak to poprawić.

Z góry dziękuje za pomoc!

ps. chyba w złe forum wstawiłem ten temat, raczej powinien być w CSS - przepraszam i proszę o przeniesienie o ile trzeba.
pedro84
Powinno być:
  1. #tabs .col li a {position:relative;z-index:1;}

Tutaj zobacz jakie wartości może przyjmować display. Powinno pomóc.
Fo
tak faktycznie - pomyliłem display z position - już to poprawiłem w poście - ale to nadal nie pomaga pod ie6/ie7

dobra już znalazłem rozwiązanie dla problemu z-indexów pod ie6/ie7 - dla zainteresowanych: http://snipplr.com/view.php?codeview&id=18675
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.