Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jquery] .hover dla 1. elementu danej klasy
ir3nicus
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 16.11.2010

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


Witam mam nastepujacy kod:


  1. <div id="teamBoxes">
  2. <span class="team">
  3. <img class="logo" src="gfx/teamLogo.png" alt="Logo" width="46px" height="46px" /><h2>Ciche Żuczki</h2>
  4. <p><img src="gfx/counts/6.png" /><img src="gfx/counts/7.png" /><img src="gfx/counts/9.png" /></p>
  5. <div class="desc"><b>meczy</b><br />12 zawodników</div>
  6. </span>
  7. <span class="team">
  8. <img class="logo" src="gfx/teamLogo.png" alt="Logo" width="46px" height="46px" /><h2>Kowale</h2>
  9. <p><img src="gfx/counts/6.png" /><img src="gfx/counts/7.png" /><img src="gfx/counts/9.png" /></p>
  10. <div class="desc"><b>meczy</b><br />12 zawodników</div>
  11. </span>
  12. <span class="team">
  13. <img class="logo" src="gfx/teamLogo.png" alt="Logo" width="46px" height="46px" /><h2>Dzikie Bawoły </h2>
  14. <p><img src="gfx/counts/6.png" /><img src="gfx/counts/7.png" /><img src="gfx/counts/9.png" /></p>
  15. <div class="desc"><b>meczy</b><br />12 zawodników</div>
  16. </span>
  17. <span class="team">
  18. <img class="logo" src="gfx/teamLogo.png" alt="Logo" width="46px" height="46px" /><h2>Colki</h2>
  19. <p><img src="gfx/counts/6.png" /><img src="gfx/counts/7.png" /><img src="gfx/counts/9.png" /></p>
  20. <div class="desc"><b>meczy</b><br />12 zawodników</div>
  21. </span>
  22.  


  1. css
  2.  
  3. span.team:hover { background: url('../gfx/zagrajBtn.png') no-repeat; cursor: pointer; }
  4.  


Chciałbym, żeby po najechaniu na każego spana o klasie 'team', podane selektory zniknęły ale tylko w tym spanie. O to mój jquery code:
  1. $('.team').hover(function () {
  2. $('p').hide();
  3. $('.desc').hide();
  4. $('h2').css('color', '#fff');
  5. });


Nie wiem jak zrobić żeby tylko w najechanym spanie a nie we wszystkich był efekt. Gdyby to był tylko jeden element albo tylko hide to uzyl bym "this" ale tutaj zmieniam kolor także dla h2. czy ktoś podpowie jak dostać się do h2, p ale tylko tego konkretnego spana nie wszystkich o tej klasie? Css dzala tak jak powinien

Ten post edytował ir3nicus 28.08.2011, 11:01:15
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: 23.08.2025 - 23:41